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

Change behavior of top bar "maximize" control #811

Open
McBaws opened this issue Dec 1, 2023 · 13 comments
Open

Change behavior of top bar "maximize" control #811

McBaws opened this issue Dec 1, 2023 · 13 comments

Comments

@McBaws
Copy link

McBaws commented Dec 1, 2023

The "maximize" button in the top bar controls does not maximize mpv, but fullscreens it instead.

In my opinion, it would be more useful if it acted like every other maximize/restore button on windows, especially given the fact that a fullscreen control element already exists in uosc.

@hooke007
Copy link
Contributor

hooke007 commented Dec 1, 2023

borderless maximize is buggy on windows.
#203

@tomasklaen
Copy link
Owner

tomasklaen commented Dec 7, 2023

Yeah we have tons of issues with the maximize command in top bar, even on other systems. We even have a special handling function that determines what to do in different environments/scenarios so that it doesn't break stuff:

local function get_maximized_command()
	if state.platform == 'windows' then
		return state.border
			and (state.fullscreen and 'set fullscreen no;cycle window-maximized' or 'cycle window-maximized')
			or 'set window-maximized no;cycle fullscreen'
	end
	return state.fullormaxed and 'set fullscreen no;set window-maximized no' or 'set window-maximized yes'
end

And there are still issues (#795).

I'm pretty much ready to swap the maximize button to just toggle fullscreen everywhere and remove fullscreen button from default controls list.

@kasper93
Copy link

kasper93 commented Dec 7, 2023

For Windows suggested default configuration should be

title-bar=no
border=yes

and in uosc

window_border_size=0

to have all compositor features like limiting the window to work area and so on. border=no is pure borderless window and it behaves differently as designed by Microsoft.

@tomasklaen
Copy link
Owner

For Windows suggested default configuration should be

I get this ugly no top border look on Win 10:

image

I prefer the broken maximize button to be honest :)

@kasper93
Copy link

kasper93 commented Dec 7, 2023

Ah, this, yeah it is fixed in Windows 11. Couldn't fine a way to workaround this on Windows 10. Except obviously hiding all borders. Which actually might be better than this.

EDIT: Does this build help https://github.com/mpv-player/mpv/actions/runs/7129695802?pr=12894 ?

@candrapersada
Copy link

For Windows suggested default configuration should be

I get this ugly no top border look on Win 10:

image

I prefer the broken maximize button to be honest :)

try

autofit=100%
border=no
window-maximized=no
fullscreen=no

@McBaws
Copy link
Author

McBaws commented Dec 7, 2023

title-bar=no
border=yes

and in uosc

window_border_size=0

This is exactly what I was looking for, maximizing works properly with this config.
I did not know about all the intricacies surrounding this feature.

@tomasklaen
Copy link
Owner

Does this build help https://github.com/mpv-player/mpv/actions/runs/7129695802?pr=12894 ?

With this all of the borders are gone completely, and maximizing produces a window that covers around 20px of the top of the taskbar.

@kasper93
Copy link

kasper93 commented Dec 9, 2023

With this all of the borders are gone completely

Expected, there is no easy way to workaround the top bar sizing issue on Windows 10, without removing WS_CAPTION, which in turn would work as --no-border.

While we could limit --no-border size to work rect, it makes thing more complicated and the different behavior between --border and --title-bar is here so you can pick which behavior is preferred. (and I want to avoid adding too much custom sizing code...)

and maximizing produces a window that covers around 20px of the top of the taskbar.

I tested in VM briefly now, will be fixed by latest build in mpv-player/mpv#12894 (https://github.com/mpv-player/mpv/actions/runs/7148952167)

@tomasklaen
Copy link
Owner

So title-bar=no will produce a window without borders on Win 10, and with borders on Win 11?

I don't personally care either way, asking just so that I know that there's no way for uosc to determine whether to draw our border or not depending on title-bar state, and that it'll have to be done by users manually in their configs.

@kasper93
Copy link

kasper93 commented Dec 9, 2023

I will add visible-window-border property to give that information to scripts, depending on what compositor is doing.

Also I need to fix this

	if state.platform == 'windows' then
		return state.border
			and (state.fullscreen and 'set fullscreen no;cycle window-maximized' or 'cycle window-maximized')
			or 'set window-maximized no;cycle fullscreen'
	end

because it shouldn't live in the lua script. And native OSC have the same issue already.

Just need to find some time to mess with this again.

@candrapersada
Copy link

candrapersada commented Dec 11, 2023

how to Change behavior of top bar "maximize" control in mpvnet?

@hooke007
Copy link
Contributor

how to use title-bar=no in mpvnet?

Here is not mpvnet's issue tracker. Why not ask your questions there?

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