Page 1 of 1

WM_CLASS not set correctly on OpenBSD

Posted: 2013-05-18T10:42:45-07:00
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