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.
This commit is contained in:
Uoti Urpala 2011-07-06 08:42:57 +03:00
parent aeafa7a2b4
commit 47ccb48ac9
1 changed files with 2 additions and 3 deletions

View File

@ -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);