[MPlayer-cvslog] CVS: main/libvo x11_common.c,1.206,1.207
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Wed Apr 19 17:58:12 CEST 2006
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv1291
Modified Files:
x11_common.c
Log Message:
Register for window-manager delete window events and quit MPlayer.
slightly modified patch from Rickard Narstrom (rickard narstrom at gmail com)
Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -r1.206 -r1.207
--- x11_common.c 16 Apr 2006 13:38:28 -0000 1.206
+++ x11_common.c 19 Apr 2006 15:58:10 -0000 1.207
@@ -100,6 +100,8 @@
static Atom XA_WIN_LAYER;
static Atom XA_WIN_HINTS;
static Atom XA_BLACKBOX_PID;
+static Atom XAWM_PROTOCOLS;
+static Atom XAWM_DELETE_WINDOW;
#define XA_INIT(x) XA##x = XInternAtom(mDisplay, #x, False)
@@ -357,6 +359,8 @@
XA_INIT(_WIN_LAYER);
XA_INIT(_WIN_HINTS);
XA_INIT(_BLACKBOX_PID);
+ XA_INIT(WM_PROTOCOLS);
+ XA_INIT(WM_DELETE_WINDOW);
}
void update_xinerama_info(void) {
@@ -1137,6 +1141,11 @@
XSetWMNormalHints(mDisplay, vo_window, &vo_hint);
vo_fs_flip = 0;
break;
+ case ClientMessage:
+ if (Event.xclient.message_type == XAWM_PROTOCOLS &&
+ Event.xclient.data.l[0] == XAWM_DELETE_WINDOW)
+ mplayer_put_key(KEY_CLOSE_WIN);
+ break;
}
}
return ret;
@@ -1241,6 +1250,7 @@
ret_win =
XCreateWindow(mDisplay, mRootWin, x, y, width, height, 0, depth,
CopyFromParent, vis, xswamask, &xswa);
+ XSetWMProtocols(mDisplay, ret_win, &XAWM_DELETE_WINDOW, 1);
if (!f_gc)
f_gc = XCreateGC(mDisplay, ret_win, 0, 0);
XSetForeground(mDisplay, f_gc, 0);
More information about the MPlayer-cvslog
mailing list