summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-30 22:09:40 +0100
committerwm4 <wm4@nowhere>2013-10-30 22:19:32 +0100
commit50e57c346faf3e00a82d0c4035f8eabeb622f486 (patch)
treee0680084426e52783e9046d94982efa2501fe642 /video
parent7743ed2dc61a256afff53411b6629b25b0dd44ea (diff)
downloadmpv-50e57c346faf3e00a82d0c4035f8eabeb622f486.tar.bz2
mpv-50e57c346faf3e00a82d0c4035f8eabeb622f486.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c6
1 files 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) {