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

Topbar won't hide automatically after entering fullscreen #880

Open
hooke007 opened this issue Apr 4, 2024 · 12 comments
Open

Topbar won't hide automatically after entering fullscreen #880

hooke007 opened this issue Apr 4, 2024 · 12 comments

Comments

@hooke007
Copy link
Contributor

hooke007 commented Apr 4, 2024

Reproduced on Mac : If the cursor is near the topbar before cycling fullscreen...

@tomasklaen
Copy link
Owner

We already do cursor:leave() here:

uosc/src/uosc/main.lua

Lines 425 to 430 in 6fa34c3

function update_fullormaxed()
state.fullormaxed = state.fullscreen or state.maximized
update_display_dimensions()
Elements:trigger('prop_fullormaxed', state.fullormaxed)
cursor:leave()
end

Don't know what else we can do.

Or do you mean that the cursor is at the top of the screen, and when the mpv gets fullscreened, the top bar lands below it, then mpv sends us the new cursor position, so the top bar becomes visible?

@hooke007
Copy link
Contributor Author

hooke007 commented Apr 5, 2024

Yeah I do check the function there. It's odd that it doesn't work for Mac.

recording2.mov

@hooke007
Copy link
Contributor Author

hooke007 commented Apr 5, 2024

5.0.0 works well. I'll try to trace deeper.

@hooke007
Copy link
Contributor Author

hooke007 commented Apr 5, 2024

26d71a8 It broke the behav on Mac.

@christoph-heinrich
Copy link
Contributor

Is that new? There have been a lot of changes to the mac code in mpv lately.

@hooke007
Copy link
Contributor Author

hooke007 commented Apr 5, 2024

There have been a lot of changes to the mac code in mpv lately.

Those commits doesn't have effect on this issue. Tested both with mpv0.36 --- master.

@tomasklaen
Copy link
Owner

Since that commit, we're firing global_mouse_enter before updating proximities, which might be the cause here, but can't check now.

@christoph-heinrich
Copy link
Contributor

christoph-heinrich commented Apr 7, 2024

Idk if this will help here, but maybe logging when which property changes helps in figuring out what's different on mac.

do
	local msg = require('mp.msg')
	local utils = require('mp.utils')
	do
		local orig_fn = mp.observe_property
		mp.observe_property = function(name, _type, callback)
			orig_fn(name, _type, function(pname, val)
				msg.info("[logreplay][observe_property]", pname, utils.format_json(val))
				callback(pname, val)
			end)
		end
	end
end

Putting this at the start of main.lua should end up logging all property change callbacks.

@hooke007
Copy link
Contributor Author

hooke007 commented Apr 7, 2024

mac.txt

[uosc] [observe_property] mouse-pos table {"hover":true,"x":0,"y":0}

It appears many times.

@christoph-heinrich
Copy link
Contributor

How come mouse-pos is never anything other then 0, 0 for you? It's like you never moved the cursor near the top bar.
For me doing that generates a lot of mouse-pos updates like:

[   2.724][i][uosc] [logreplay][observe_property] mouse-pos table {"y":18,"hover":true,"x":94} 
[   2.732][i][uosc] [logreplay][observe_property] mouse-pos table {"y":20,"hover":true,"x":95} 
[   2.740][i][uosc] [logreplay][observe_property] mouse-pos table {"y":21,"hover":true,"x":96} 
[   2.748][i][uosc] [logreplay][observe_property] mouse-pos table {"y":22,"hover":true,"x":96} 
[   2.772][i][uosc] [logreplay][observe_property] mouse-pos table {"y":23,"hover":true,"x":96} 
[   2.796][i][uosc] [logreplay][observe_property] mouse-pos table {"y":23,"hover":true,"x":97} 
[   2.804][i][uosc] [logreplay][observe_property] mouse-pos table {"y":24,"hover":true,"x":97} 
[   2.812][i][uosc] [logreplay][observe_property] mouse-pos table {"y":25,"hover":true,"x":98} 
[   2.820][i][uosc] [logreplay][observe_property] mouse-pos table {"y":26,"hover":true,"x":98} 
[   2.828][i][uosc] [logreplay][observe_property] mouse-pos table {"y":26,"hover":true,"x":99} 
[   2.836][i][uosc] [logreplay][observe_property] mouse-pos table {"y":27,"hover":true,"x":99} 
[   2.844][i][uosc] [logreplay][observe_property] mouse-pos table {"y":28,"hover":true,"x":99}

It's also interesting how on mac changing fullscreen resizes the window a bunch of times. Meanwhile on kwin wayland it immediately changes to the final size and the upscale animation is only scaling of the texture.

@AndydeCleyre
Copy link

We already do cursor:leave() here:

uosc/src/uosc/main.lua

Lines 425 to 430 in 6fa34c3

function update_fullormaxed()
state.fullormaxed = state.fullscreen or state.maximized
update_display_dimensions()
Elements:trigger('prop_fullormaxed', state.fullormaxed)
cursor:leave()
end

Does that get run in the case mpv starts in fullscreen? I often start videos without a mouse at hand and get stuck with the title.

@christoph-heinrich
Copy link
Contributor

We already do cursor:leave() here:

uosc/src/uosc/main.lua

Lines 425 to 430 in 6fa34c3

function update_fullormaxed()
state.fullormaxed = state.fullscreen or state.maximized
update_display_dimensions()
Elements:trigger('prop_fullormaxed', state.fullormaxed)
cursor:leave()
end

Does that get run in the case mpv starts in fullscreen? I often start videos without a mouse at hand and get stuck with the title.

That runs every time the fullscreen or window-maximized properties change, and also once on initialization for both.

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

4 participants