summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossy@jrg.systems>2019-12-28 02:12:44 +1100
committerJan Ekström <jeebjp@gmail.com>2020-01-26 15:36:12 +0200
commit80423e5b5534e6e648c53db931c27c74867898e1 (patch)
treeed6989e8e5ce4d0819cf322aa77030bf7cd3790e /player
parent48880d827d6a7eece1ddc3736d6a953195f69332 (diff)
downloadmpv-80423e5b5534e6e648c53db931c27c74867898e1.tar.bz2
mpv-80423e5b5534e6e648c53db931c27c74867898e1.tar.xz
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
Diffstat (limited to 'player')
0 files changed, 0 insertions, 0 deletions