mpv icon indicating copy to clipboard operation
mpv copied to clipboard

win32: fix resizing window when maximized

Open kasper93 opened this issue 1 year ago • 7 comments

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

Fixes: #14126

kasper93 avatar May 12 '24 15:05 kasper93

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

kasper93 avatar May 12 '24 15:05 kasper93

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.

na-na-hi avatar May 12 '24 16:05 na-na-hi

Maybe this time, it restores the size.

kasper93 avatar May 12 '24 18:05 kasper93

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

na-na-hi avatar May 12 '24 19:05 na-na-hi

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?

kasper93 avatar Jun 02 '24 12:06 kasper93

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 avatar Jun 02 '24 13:06 na-na-hi

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

kasper93 avatar Oct 06 '24 15:10 kasper93

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.

na-na-hi avatar Oct 06 '24 18:10 na-na-hi

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?

kasper93 avatar Oct 06 '24 19:10 kasper93

Does it work now for you?

Yes, it's fixed now.

na-na-hi avatar Oct 06 '24 22:10 na-na-hi

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

verygoodlee avatar Oct 08 '24 08:10 verygoodlee