diff options
author | wm4 <wm4@nowhere> | 2014-02-02 01:35:46 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-12 22:30:23 +0100 |
commit | de6a452039262fdd2700a6319346db744565f8e6 (patch) | |
tree | c59f045e30a366cfd3189b3c6592108d25f35629 /player/lua.h | |
parent | 4b764b6cc64e72072b8f8201329570607792f4a1 (diff) | |
download | mpv-de6a452039262fdd2700a6319346db744565f8e6.tar.bz2 mpv-de6a452039262fdd2700a6319346db744565f8e6.tar.xz |
x11: fix race condition when setting aspect when leaving fullscreen
vo_opengl creates a hidden X11 window to probe the OpenGL context. It
must do that before creating a visible window, because VO creation and
VO config are separate phases.
There's a race condition involving the hidden window: when starting with
--fs, and then leaving fullscreen, the unfullscreened window is
sometimes set to the aspect ratio of the hidden window. I'm not sure why
the window size itself uses the correct size (but corrupted by the wrong
aspect), but that's perhaps because the window manager is free to ignore
the size hint while honoring the aspect, or something equally messed up.
It turns out this happens because x11_common.c thinks the size of the
hidden window is the size of the unfullscreened window. This in turn
happens because vo_x11_update_geometry() reads the size of the hidden
window when called in vo_x11_fullscreen() (called from
vo_x11_config_vo_window()) when mapping the fullscreen window. At that
point, the window could be mapped, but not necessarily. If it's not
mapped, it will get the size of the unfullscreened window... I think.
One could fix this by actively waiting until the window is mapped. Try
to pick a less hacky approach instead, and never read the window size
until MapNotify is received.
vo_x11_create_window() needs a hack, because we'd possibly set the VO's
size to 0, resulting e.g. in vdpau to fail initialization. (It'll print
error messages until a proper resize is received.)
Conflicts:
video/out/x11_common.c
Diffstat (limited to 'player/lua.h')
0 files changed, 0 insertions, 0 deletions