Skip to content

Commit

Permalink
x11: clear window on map
Browse files Browse the repository at this point in the history
vo_x11_map_window() was attempting to clear the window on map. However,
it did so immediately after the map request. It probably assumed that
the drawing calls for clearing the window would be queued along with the
map request, and then executed in the right order. However, this
assumption was wrong - the map request first has to go to the window
manager (I guess?), so a lot of things happen before the window is even
mapped.

Fix this by moving the call to the MapNotify message handler, when the
window (apparently) becomes really visible.

I also tried to set CWBackPixel to black instead, but this seemed to
result in flickering on manual resizing.
  • Loading branch information
wm4 committed May 15, 2014
1 parent 9bfe3f3 commit 8f29f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion video/out/x11_common.c
Expand Up @@ -982,6 +982,7 @@ int vo_x11_check_events(struct vo *vo)
break;
case MapNotify:
x11->window_hidden = false;
vo_x11_clearwindow(vo, x11->window);
vo_x11_update_geometry(vo);
x11->vo_hint.win_gravity = x11->old_gravity;
XSetWMNormalHints(display, x11->window, &x11->vo_hint);
Expand Down Expand Up @@ -1307,7 +1308,6 @@ static void vo_x11_map_window(struct vo *vo, int x, int y, int w, int h)
ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | LeaveWindowMask);
XMapWindow(x11->display, x11->window);
vo_x11_clearwindow(vo, x11->window);
}

static void vo_x11_highlevel_resize(struct vo *vo, int x, int y, int w, int h)
Expand Down

0 comments on commit 8f29f6f

Please sign in to comment.