mpv/video/out
wm4 ba35335939 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.
2013-03-03 15:36:27 +01:00
..
aspect.c options: move -geometry parsing to m_option.c 2013-01-23 10:56:11 +01:00
aspect.h
bitmap_packer.c
bitmap_packer.h
cocoa_common.h video/out: rename create_window to config_window 2013-02-26 02:01:48 +01:00
cocoa_common.m video/out: rename create_window to config_window 2013-02-26 02:01:48 +01:00
d3d_shader_yuv.h
d3d_shader_yuv.hlsl vo_direct3d: remove 2ch hack for 10 bit playback 2013-01-13 20:04:14 +01:00
filter_kernels.c
filter_kernels.h
gl_common.c wayland: add wayland support 2013-02-28 20:01:33 +01:00
gl_common.h wayland: add wayland support 2013-02-28 20:01:33 +01:00
gl_header_fixes.h
gl_osd.c
gl_osd.h
osx_common.h osxbundle: cocoa_common: change playlist on fileopen events 2013-01-16 22:27:04 +01:00
osx_common.m Prefix keycode defines with MP_ 2013-02-12 10:27:00 +01:00
pnm_loader.c
pnm_loader.h
vo.c core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
vo.h x11_common: use private variables for window state 2013-03-03 14:19:57 +01:00
vo_caca.c vo_caca: remove OSD support 2013-02-24 16:15:50 +01:00
vo_corevideo.h
vo_corevideo.m core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
vo_direct3d.c core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
vo_image.c m_option: don't define OPT_BASE_STRUCT by default 2013-03-01 11:27:59 +01:00
vo_lavc.c core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
vo_null.c core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
vo_opengl.c video/out: remove VO_EVENT_REINIT 2013-03-03 14:19:57 +01:00
vo_opengl_old.c video/out: remove VO_EVENT_REINIT 2013-03-03 14:19:57 +01:00
vo_opengl_shaders.glsl vo_opengl: use more precise gamma for BT.709 with color management 2012-12-28 13:43:24 +01:00
vo_sdl.c m_option: don't define OPT_BASE_STRUCT by default 2013-03-01 11:27:59 +01:00
vo_vdpau.c m_option: don't define OPT_BASE_STRUCT by default 2013-03-01 11:27:59 +01:00
vo_x11.c core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
vo_xv.c core: simplify OSD capability handling, remove VFCAP_OSD 2013-03-01 11:16:01 +01:00
w32_common.c x11_common: use private variables for window state 2013-03-03 14:19:57 +01:00
w32_common.h w32_common: remove unused variable 2013-03-03 14:19:53 +01:00
wayland_common.c x11_common: use private variables for window state 2013-03-03 14:19:57 +01:00
wayland_common.h x11_common: use private variables for window state 2013-03-03 14:19:57 +01:00
x11_common.c x11_common: fix window mapping, refactor window creation/resize handling 2013-03-03 15:36:27 +01:00
x11_common.h x11_common: fix window mapping, refactor window creation/resize handling 2013-03-03 15:36:27 +01:00