summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-06 08:42:57 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-06 08:42:57 +0300
commit47ccb48ac9a31dfc43484f7d8f5f8693f774c6e4 (patch)
tree5e014e8f40377830c6bda29f2ff7d85309e40c1e
parentaeafa7a2b46e8ee84c9fe277d9cc6f14666a0465 (diff)
downloadmpv-47ccb48ac9a31dfc43484f7d8f5f8693f774c6e4.tar.bz2
mpv-47ccb48ac9a31dfc43484f7d8f5f8693f774c6e4.tar.xz
vo: avoid losing initial expose event
The x11_common.c window creation code could lose the initial expose event due to input mask changes. This meant that the window might not be cleared at start (there's a vo_x11_clearwindow() call but it may do nothing if it runs before the window is mapped). Modify the code to avoid losing the expose event. Handling that event should ensure the window is cleared and otherwise set up properly.
-rw-r--r--libvo/x11_common.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index b9e1c03745..ac8c37216e 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -1100,13 +1100,12 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
XSetStandardProperties(mDisplay, x11->window, title, title, None, NULL, 0, &hint);
if (!vo_border) vo_x11_decoration(vo, 0);
// map window
- XMapWindow(mDisplay, x11->window);
- vo_x11_clearwindow(vo, x11->window);
XSelectInput(mDisplay, x11->window, NoEventMask);
- XSync(mDisplay, False);
vo_x11_selectinput_witherr(mDisplay, x11->window,
StructureNotifyMask | KeyPressMask | PointerMotionMask |
ButtonPressMask | ButtonReleaseMask | ExposureMask);
+ XMapWindow(mDisplay, x11->window);
+ vo_x11_clearwindow(vo, x11->window);
}
if (opts->vo_ontop) vo_x11_setlayer(vo, x11->window, opts->vo_ontop);
vo_x11_update_geometry(vo, !geometry_xy_changed);