changeset 6401:15a6a5c78f35

Michele Balistreri <brain87@gmx.net>: This patch makes MPlayer more NetWM compliant, setting the pid of the application as a property of the window. It helps the applications trying to swallow mplayer (e.g. a browser plugin). Me: Various warning/compile fixes.
author atmos4
date Wed, 12 Jun 2002 22:57:58 +0000
parents 8d332415d037
children 57e4ced19a03
files libvo/x11_common.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/x11_common.c	Wed Jun 12 20:18:12 2002 +0000
+++ b/libvo/x11_common.c	Wed Jun 12 22:57:58 2002 +0000
@@ -1,9 +1,11 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "config.h"
 #include "mp_msg.h"
+#include "x11_common.h"
 
 #ifdef X11_FULLSCREEN
 
@@ -511,9 +513,11 @@
 
 void vo_x11_classhint( Display * display,Window window,char *name ){
 	    XClassHint wmClass;
+	    pid_t pid=getpid();
 	    wmClass.res_name = name;
 	    wmClass.res_class = "MPlayer";
 	    XSetClassHint(display,window,&wmClass);
+	    XChangeProperty(display,window, XInternAtom(display,"_NET_WM_PID", False), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1);
 }
 
 Window     vo_window = None;