[MPlayer-cvslog] r34005 - trunk/libvo/x11_common.c

cigaes subversion at mplayerhq.hu
Sat Aug 20 12:19:23 CEST 2011


Author: cigaes
Date: Sat Aug 20 12:19:23 2011
New Revision: 34005

Log:
x11_common: XChangeProperty uses long for 32-bits.

Adapted from a patch in OpenBSD's ports tree,
with suggestions from Alexander Strasser.

Modified:
   trunk/libvo/x11_common.c

Modified: trunk/libvo/x11_common.c
==============================================================================
--- trunk/libvo/x11_common.c	Sat Aug 20 10:18:36 2011	(r34004)
+++ trunk/libvo/x11_common.c	Sat Aug 20 12:19:23 2011	(r34005)
@@ -729,12 +729,18 @@ void vo_x11_classhint(Display * display,
 {
     XClassHint wmClass;
     pid_t pid = getpid();
+    long prop = pid & 0x7FFFFFFF;
 
     wmClass.res_name = vo_winname ? vo_winname : name;
     wmClass.res_class = "MPlayer";
     XSetClassHint(display, window, &wmClass);
+
+    /* PID sizes other than 32-bit are not handled by the EWMH spec */
+    if ((pid_t)prop != pid)
+        return;
+
     XChangeProperty(display, window, XA_NET_WM_PID, XA_CARDINAL, 32,
-                    PropModeReplace, (unsigned char *) &pid, 1);
+                    PropModeReplace, (unsigned char *)&prop, 1);
 }
 
 Window vo_window = None;


More information about the MPlayer-cvslog mailing list