WM_CLASS not set correctly on OpenBSD

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
blindsay
Posts: 1
Joined: 2013-05-18T09:31:34-07:00
Authentication code: 6789

WM_CLASS not set correctly on OpenBSD

Post by blindsay »

None of the methods for getting the execution path in magick/utility.c GetExecutionPath() work on OpenBSD (and potentially the other BSDs). This leads to the X11 WM_CLASS being set to the current directory rather than the name of the program. This in turn breaks window manager handling that uses WM_CLASS. As a quick hack, I did:

Code: Select all

--- utility.c.orig  Sat May 12 21:28:56 2012
+++ utility.c   Sat May 18 12:24:00 2013
@@ -1071,6 +1071,12 @@
     execution_path=(char *) RelinquishMagickMemory(execution_path);
   }
 #endif
+#if defined(__OpenBSD__)
+  {
+    extern char *__progname;
+    CopyMagickString(path, __progname, extent);
+  }
+#endif
   return(IsPathAccessible(path));
 }
 ^L
Post Reply