1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 16:33:02 +00:00
mpv/video/out
James Ross-Gowan 80423e5b55 w32_common: support minimized and maximized properties
Add support for setting window-minimized and window-maximized in
Windows. The minimized and maximized state can be set independently.
When the window is minimized, the value of window-maximized will
determine whether the window is restored to the maximized state or not.

Changing state is done with ShowWindow(), which has commands that change
the window state and activate it (eg. SW_RESTORE) and commands that
change the window state without activating it (eg. SW_SHOWNOACTIVATE.)
It would be nice if we could use commands that don't activate the
window, so scripts could change the window state in the backrgound
without bringing it to the foreground, but there are some problems with
that. There is no command to maximize a window without activating it, so
SW_MAXIMIZE is used instead.  Also, restoring a window from minimize
without activating it seems buggy. On my Windows 10 1909 PC, it always
moves the window to the back of the z-order. SW_RESTORE is used instead
of SW_SHOWNOACTIVATE because of this.

This also changes the way the window is initially shown. Previously, the
window was made visible as a consequence of the SWP_SHOWWINDOW flag in
the first call to SetWindowPos. In order to set the initial minimized or
maximized state of the window, the window is shown with the ShowWindow
function instead, where the ShowWindow command is determined by whether
the window should be initially maximized or minimized.

Even when showing the window normally, we should still call ShowWindow
with the SW_SHOW command instead of using SetWindowPos, since the first
call a process makes to ShowWindow(SW_SHOW) has special behaviour
where it uses the show command in the process' STARTUPINFO instead of
the command passed to the function, which should fix #5724.

Note: While changes to window-minimized while in fullscreen mode should
work as expected, changing window-maximized while in fullscreen does not
work and won't result in the window changing state, even after leaving
fullscreen. For this to work correctly, the fullscreen logic needs to be
changed to apply the new maximized state on leaving fullscreen.

Fixes: #5724
Fixes: #7351
2020-01-26 15:36:12 +02:00
..
cocoa cocoa_common: remove deprecated VOCTRLs/VO_EVENTs 2019-12-12 19:56:03 +01:00
cocoa-cb cocoa-cb: add pinch to resize window gesture 2020-01-26 12:33:47 +01:00
d3d11 vo_gpu/d3d11: add support for configuring swap chain color space 2019-10-30 02:41:25 +02:00
gpu vo_gpu: fix crash if dither texture fails to allocate 2020-01-08 03:45:17 +01:00
hwdec vo_gpu: hwdec_vaapi: set correct hw_imgfmt value 2020-01-17 15:08:46 +01:00
opengl cocoa-cb: add support for forcing the dedicated GPU for rendering 2020-01-26 12:12:22 +01:00
placebo
vulkan vo_gpu: vulkan: set allow_suboptimal when possible 2019-12-22 03:55:07 +01:00
win32
android_common.c context_android: move common code to a separate file 2019-09-27 00:05:06 +03:00
android_common.h context_android: move common code to a separate file 2019-09-27 00:05:06 +03:00
aspect.c aspect: add video margin options 2019-09-19 20:37:05 +02:00
aspect.h
bitmap_packer.c video/out/bitmap_packer: Avoid empty initializer list 2019-11-18 16:50:21 +01:00
bitmap_packer.h
cocoa_cb_common.swift cocoa-cb: fix race condition on quit 2020-01-26 12:12:22 +01:00
cocoa_common.h
cocoa_common.m cocoa_common: remove deprecated VOCTRLs/VO_EVENTs 2019-12-12 19:56:03 +01:00
d3d_shader_420p.h
d3d_shader_yuv.hlsl
dither.c
dither.h
dr_helper.c client API: fix potential deadlock problems by throwing more shit at it 2019-09-26 14:14:49 +02:00
dr_helper.h client API: fix potential deadlock problems by throwing more shit at it 2019-09-26 14:14:49 +02:00
drm_atomic.c
drm_atomic.h
drm_common.c drm: avoid division by 0 in drm_pflip_cb with bad drivers 2019-12-07 18:34:25 +01:00
drm_common.h drm: avoid division by 0 in drm_pflip_cb with bad drivers 2019-12-07 18:34:25 +01:00
drm_prime.c
drm_prime.h
filter_kernels.c
filter_kernels.h
libmpv.h
vo_caca.c vo_caca: Implement VOCTRL_UPDATE_WINDOW_TITLE 2019-10-29 17:07:41 +01:00
vo_direct3d.c
vo_drm.c vo_drm: replace drmModeAddFB usage with drmModeAddFB2 2019-12-07 19:23:58 +01:00
vo_gpu.c Revert "vo: add support for externally driven renderloop and make wayland use it" 2019-10-10 17:41:19 +00:00
vo_image.c screenshot, vo_image: use global swscale/zimg parameters 2019-10-31 15:44:09 +01:00
vo_lavc.c
vo_libmpv.c client API: fix potential deadlock problems by throwing more shit at it 2019-09-26 14:14:49 +02:00
vo_mediacodec_embed.c
vo_null.c
vo_rpi.c rpi: destroy fullscreen change handling 2019-12-11 18:50:37 +01:00
vo_sdl.c vo_sdl: use new fullscreen change mechanism 2019-12-11 18:47:57 +01:00
vo_tct.c video/out/vo_tct: Use octal escape sequence instead of non-standard \e 2019-11-18 16:50:21 +01:00
vo_vaapi.c
vo_vdpau.c Replace uses of FFMIN/MAX with MPMIN/MAX 2019-10-31 11:24:20 +01:00
vo_wlshm.c sws_utils: shuffle around some shit 2019-10-31 15:26:03 +01:00
vo_x11.c vo_x11: accept zimg formats 2019-11-03 22:52:12 +01:00
vo_xv.c
vo.c vo: redraw dropped frame if paused between queuing and drawing frame 2019-12-04 23:55:42 +01:00
vo.h command, vo: add a mechanism for runtime DPI scale changes 2020-01-09 19:13:42 +01:00
w32_common.c w32_common: support minimized and maximized properties 2020-01-26 15:36:12 +02:00
w32_common.h
wayland_common.c wayland: support maximize/minimize on startup 2020-01-12 16:12:09 +00:00
wayland_common.h wayland: fix cursor behavior on an edge case 2019-12-04 00:47:05 +00:00
win_state.c win_state: silence a valgrind warning 2019-09-19 20:37:05 +02:00
win_state.h
x11_common.c video/out/x11: add fs-screen fallback 2019-12-22 02:33:48 +01:00
x11_common.h x11: use new option stuff to implement fullscreen 2019-11-29 13:56:58 +01:00