diff options
author | wm4 <wm4@nowhere> | 2013-03-02 17:08:37 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-03 15:36:27 +0100 |
commit | ba35335939c46a1ed53584c2b850c7deecbf837a (patch) | |
tree | 453f66c2af9f898a5698bdf2cf4681699b98aa3a /video/out/gl_common.c | |
parent | 1b09f46338fff38b0d442f187a4ce0513a095baa (diff) | |
download | mpv-ba35335939c46a1ed53584c2b850c7deecbf837a.tar.bz2 mpv-ba35335939c46a1ed53584c2b850c7deecbf837a.tar.xz |
x11_common: fix window mapping, refactor window creation/resize handling
vo_opengl creates an invisible window with VOFLAG_HIDDEN in order to
test whether the OpenGL context is useable. The visible window is
created at a later point. This has been broken forever (in vo_gl,
now called vo_opengl_old, it could be avoided by disabling auto-
detection explicitly using the "yuv" sub-option). Avoiding
VOFLAG_HIDDEN only mitigates the issue, and a related bug can still
happen with some window managers (see below).
As a hack, code was added to vo_gl to destroy the (hidden) window so
that all state was destroyed. Later, more hacks were added to deal with
some caveats that came with recreating the window, such as probing for
the context up to 4 times.
Attempt to fix the problem properly. There were two problems: first,
the window was not resized to video size before mapping. This was the
main cause for the placement issue, e.g. mapping the window as 320x200,
and then resizing it. Second, mpv tried to force the window position
with XSetWMNormalHints and PPosition with values it just read with
XGetGeometry. This messes up the window manager's default placement.
It seems to be a race condition, and behavior is different across
various WMs too: with IceWM, the window manager's placement is usually
preferred, and with Fluxbox, mpv's position is preferred. mpv's default
position is centering the window on the screen, which is much nicer for
video in general than typical WM default placement, so it's possible
that this bug was perceived as a feature. (Users who want this have to
use --geometry="50%:50%", doing this by default is probably not safe
with all WMs.)
Since the old code was hard to follow and full of issues, it's easier
to redo it. Move general window creation stuff out of the
vo_x11_config_vo_window function, and move the resize logic into it.
This has been tested on IcwWM, Fluxbox, awesome, Unity/Compiz.
Diffstat (limited to 'video/out/gl_common.c')
0 files changed, 0 insertions, 0 deletions