mpv
mpv copied to clipboard
win32: fix window maximized state after setting window size
With VOCTRL_SET_UNFS_WINDOW_SIZE, currently it only results in a SetWindowPos call to resize the window. However, SetWindowPos doesn't change the window maximized state, so Windows still thinks that the window is maximized even though it no longer covers the whole workspace. This results in visual glitches, and if the window is dragged afterwards it's "restored" again.
Fix this by unmaximize the window in this case, which also matches the behavior of X11 and Wayland.
Also update maximized state when leaving fullscreen. Fixes https://github.com/mpv-player/mpv/issues/10687.
Download the artifacts for this pull request:
While at it you could also fix changing window-scale while in fullscreen mode. It should restore a windowed state at a new scale. Currently it just restores the previous one, which doesn't match window-scale.
I have those small patches somewhere but never bothered to upstream. My old PR with border hackery is still not merged.
Maximize with border=no is also broken. I mention it, because it is all connected...
While at it you could also fix changing window-scale while in fullscreen mode. It should restore a windowed state at a new scale.
Works for me with this PR. What are your reproduction steps?
Maximize with border=no is also broken
If you're referring to the window covering the taskbar, it's a limitation of WS_POPUP windows and is unrelated to this PR.