mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.1k stars 2.88k forks source link

win32: fix resizing window when maximized #14127

Closed kasper93 closed 11 hours ago

kasper93 commented 4 months ago

This remembers and sets window-scale when exiting maximized state. Also fixes not staying in maximized state when exiting fullscreen mode.

Fixes: #14126

kasper93 commented 4 months ago

@na-na-hi: I actually had this patch in my local branch for a long time, you could check if you'd like, but for me it was working fine for long time.

github-actions[bot] commented 4 months ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1495111679.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1495112198.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1495120032.zip)
macOS * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1495111266.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1495112037.zip) * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1495114702.zip)
na-na-hi commented 4 months ago

With the fullscreen - maximize - set geometry 500x500 - unfullscreen sequence, the window no longer changes to the specified geometry after unfullscreen. Although current master doesn't unset the maximized state in this case so it's also wrong.

kasper93 commented 4 months ago

Maybe this time, it restores the size.

na-na-hi commented 4 months ago

It still doesn't restore to the specified geometry for me.

kasper93 commented 4 months ago

It still doesn't restore to the specified geometry for me.

@na-na-hi: I've taken a look again at this. It seems to work correctly for me.

  1. set fullscreen yes
  2. set window-maximized yes
  3. set geometry 500x500
  4. set fullscreen no
  5. set window-maximized no

Window is 500x500 after this sequence. Could you help me reproduce the issue?

EDIT:

Or you mean at step 4. it should already go into 500x500 window? I think we have to align on the behavior here. Should set geometry cancel fullscreen and/or window-maximized?

na-na-hi commented 4 months ago

Or you mean at step 4. it should already go into 500x500 window?

Yes, this is the current expectation. Setting geometry unmaximizes the window to the specified size. If the window is fullscreen, it's applied when exiting fullscreen.

kasper93 commented 18 hours ago

@na-na-hi forgot about this, could you test latest version?

na-na-hi commented 15 hours ago

With the newest version, the problem I mentioned before doesn't happen anymore, but now set window-maximized yes - set fullscreen yes - set fullscreen no would unmaximize the window when exiting fullscreen, when it should return to maximized state.

kasper93 commented 14 hours ago

With the newest version, the problem I mentioned before doesn't happen anymore, but now set window-maximized yes - set fullscreen yes - set fullscreen no would unmaximize the window when exiting fullscreen, when it should return to maximized state.

Does it work now for you?

na-na-hi commented 11 hours ago

Does it work now for you?

Yes, it's fixed now.