From 47ccb48ac9a31dfc43484f7d8f5f8693f774c6e4 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 6 Jul 2011 08:42:57 +0300 Subject: 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. --- libvo/x11_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libvo/x11_common.c') 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); -- cgit v1.2.3