Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximize window button not working correctly #203

Closed
NaiveInvestigator opened this issue Sep 15, 2022 · 8 comments
Closed

Maximize window button not working correctly #203

NaiveInvestigator opened this issue Sep 15, 2022 · 8 comments

Comments

@NaiveInvestigator
Copy link

If the fullscreen is used, using the other button fullscreen button or using cycle fullscreen doesn't minimize the window.
image

@tomasklaen tomasklaen changed the title [Minor Bug]: Topscreen Fullscreen button not working Maximize window button not working correctly Sep 15, 2022
@tomasklaen
Copy link
Owner

Yes that's a known issue (can't find where we discussed this before though). All uosc does when you click the button is cycle window-maximized command, so it's on mpv to handle that correctly, and it currently doesn't.

This comment is the best explanation I could find as to what is happening: mpv-player/mpv#7887 (comment)

@tomasklaen
Copy link
Owner

I think I'll give the button some logic to work around this. It's not acceptable for that button to be this broken.

@natural-harmonia-gropius
Copy link
Contributor

There's another issue that set fullscreen no; set window-maximized no will not work properly when you maximize the window and then turn it to fullscreen.

Try this, although in the above scenario you need to click twice.
https://github.com/Natural-Harmonia-Gropius/uosc/blob/c184cc1c2956770827ddefddd84f2eca13ebf7f5/scripts/uosc.lua#L2959

@hooke007
Copy link
Contributor

Not sure about mpv's behavior when using no-border on Linux. I would never touch that button on Windows for one part of output will be covered by win-taskbar.

I think I'll give the button some logic to work around this.

How about this idea?

  • if border=no
    →→ button_win-max: cycle fullscreen (same as button_fullscreen)

  • if border=yes

    • if fullscreen=yes
      →→ button_win-max: set fullscreen no cycle window-maximized
    • if fullscreen=no
      →→ button_win-max: cycle window-maximized

@tomasklaen
Copy link
Owner

tomasklaen commented Sep 19, 2022

This should be the best we can do in this situation. I personally couldn't find a state where it still does something bad.

It's pretty much the logic described by @hooke007 above, but I added set window-maximized no;cycle fullscreen to border=no state.

@christoph-heinrich
Copy link
Contributor

christoph-heinrich commented Nov 14, 2023

I think we need to make this behavior platform specific or turn the maximize button into effectively a fullscreen button, because it's horribly broken for me on kde plasma on wayland.
Related mpv-player/mpv#11575

I never use that button, so I never noticed before.
image
It's switching between fullscreen=yes and maximized=yes because border changes to border=yes in fullscreen.
That might be limited to kde on wayland, I didn't test any other ones.

Does anyone even maximize their player? I'm always either fullscreen or windowed, but changing it away from maximize to fullscreen in general might undermine the expectation of users... it would be really simple though.

local function get_maximized_command()
	return state.fullormaxed and 'set window-maximized no;set fullscreen no' or 'set fullscreen yes'
end

@tomasklaen
Copy link
Owner

There are valid use cases for maximized state. Like I sometimes use it when watching something on a secondary monitor but still want to see notifications in taskbar.

I wouldn't mind making it platform specific, but as you noted, is it a platform issue, or a desktop environment issue?

@christoph-heinrich
Copy link
Contributor

is it a platform issue, or a desktop environment issue?

I'd assume the border thing is desktop environment specific, but it doesn't really matter, because only windows has that quirk with borderless windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants