mpv
mpv copied to clipboard
win32: fix resizing window when maximized
This remembers and sets window-scale when exiting maximized state. Also fixes not staying in maximized state when exiting fullscreen mode.
Fixes: #14126
@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.
Download the artifacts for this pull request:
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.
Maybe this time, it restores the size.
It still doesn't restore to the specified geometry for me.
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.
- set fullscreen yes
- set window-maximized yes
- set geometry 500x500
- set fullscreen no
- 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?
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.
@na-na-hi forgot about this, could you test latest version?
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.
With the newest version, the problem I mentioned before doesn't happen anymore, but now
set window-maximized yes - set fullscreen yes - set fullscreen nowould unmaximize the window when exiting fullscreen, when it should return to maximized state.
Does it work now for you?
Does it work now for you?
Yes, it's fixed now.
brings a new issue, in --no-title-bar mode, unmaximize cannot restore the window to manually adjusted postion and size.
mpv any.jpg --no-title-bar --autofit-larger=70%x70% --geometry=50%:50% --pause- adjust window positon and size manually
- set window-maximized yes
- set window-maximized no
https://github.com/user-attachments/assets/ba436c06-a828-45da-9507-68bbd596d5b1
there's no issue if use the maximize button provided by windows title bar
mpv any.jpg --autofit-larger=70%x70% --geometry=50%:50% --pause
https://github.com/user-attachments/assets/067235e5-5779-486a-a51d-62cb2a1f2d5a