From 50e57c346faf3e00a82d0c4035f8eabeb622f486 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Oct 2013 22:09:40 +0100 Subject: x11: restore support for --wid=0 This stopped working when the code was changed to create a window even if --wid is used. It appears we can't create our own window in this case, because in X11 there is no difference between a window with the root window as parent, and a window that is managed by the WM. So make this (kind of worthless) special case use the root window itself. --- video/out/x11_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 0025ef90c3..6c8ee74190 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -690,7 +690,7 @@ void vo_x11_uninit(struct vo *vo) XFreeGC(vo->x11->display, x11->f_gc); if (x11->vo_gc != None) XFreeGC(vo->x11->display, x11->vo_gc); - if (x11->window != None) { + if (x11->window != None && x11->window != x11->rootwin) { XClearWindow(x11->display, x11->window); XUnmapWindow(x11->display, x11->window); @@ -1163,6 +1163,8 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, struct vo_x11_state *x11 = vo->x11; if (opts->WinID >= 0) { + if (opts->WinID == 0) + x11->window = x11->rootwin; XSelectInput(x11->display, opts->WinID, StructureNotifyMask); vo_x11_update_geometry(vo); x = x11->win_x; y = x11->win_y; @@ -1328,7 +1330,7 @@ static void vo_x11_update_geometry(struct vo *vo) unsigned w, h, dummy_uint; int dummy_int; Window dummy_win; - Window win = vo->opts->WinID >= 0 ? vo->opts->WinID : x11->window; + Window win = vo->opts->WinID > 0 ? vo->opts->WinID : x11->window; XGetGeometry(x11->display, win, &dummy_win, &dummy_int, &dummy_int, &w, &h, &dummy_int, &dummy_uint); if (w <= INT_MAX && h <= INT_MAX) { -- cgit v1.2.3