mpv icon indicating copy to clipboard operation
mpv copied to clipboard

win32: fix window maximized state after setting window size

Open na-na-hi opened this issue 1 year ago • 3 comments

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.

na-na-hi avatar Feb 14 '24 16:02 na-na-hi

Download the artifacts for this pull request:

Windows
macOS

github-actions[bot] avatar Feb 14 '24 16:02 github-actions[bot]

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...

kasper93 avatar Feb 14 '24 18:02 kasper93

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.

na-na-hi avatar Feb 15 '24 03:02 na-na-hi