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

console.lua: disable cursor autohide while selector is open #15822

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

verygoodlee
Copy link
Contributor

This is an improvement on #15145 .
If the cursor is automatically hidden, users may not know whether they are clicking on the inside or outside of selectable items, the result after clicking is unclear to them.

@guidocella
Copy link
Contributor

I'm not sure if this is needed anyway but note that I already implemented a proper background with a horizontal hitbox so you can close by clicking outside of it horizontally, I'm just waiting for #15711 to be merged:

screenshot

We can then unbind right click like you asked if wanted.

Copy link

github-actions bot commented Feb 7, 2025

Download the artifacts for this pull request:

Windows
macOS

@verygoodlee
Copy link
Contributor Author

this looks pretty nice, similar to uosc, I have just tried the uosc and the cursor cannot be hidden while menu is open.

@guidocella
Copy link
Contributor

Yeah I blatantly copied uosc's menu since it looked better.

@Dudemanguy
Copy link
Member

Since #15711 got merged, do we need this anymore?

@verygoodlee
Copy link
Contributor Author

Since #15711 got merged, do we need this anymore?

I think we still need this since uosc has same behavior.

@guidocella
Copy link
Contributor

guidocella commented Feb 17, 2025

Needs rebase. Since you can now seamlessly go from input.select -> input.get without going through set_active, cursor-autohide can be restored within unbind_mouse().

I'm not sure on the other hand if disabling cursor-autohide should go inside bind_mouse(), this would also disable it when searching the command history, and while I made sure the new hitbox works with it, this may be unwanted since I doubt anyone uses the mouse for that (currently it's not even useful in upstream until persisting history is merged).

Edit: actually this is much trickier now since you can do input.select -> input.select and mp.get_property_native('cursor-autohide') will no longer return the value from before opening the console. I think you can always retrieve the value in set_active() and do the toggling separately in bind_mouse() and unbind_mouse().

This is an improvement on mpv-player#15145 .
If the cursor is automatically hidden, users may not know whether
they are clicking on the inside or outside of selectable items,
the result after clicking is unclear to them.
@verygoodlee
Copy link
Contributor Author

I think you can always retrieve the value in set_active() and do the toggling separately in bind_mouse() and unbind_mouse().

retrieve value can also move into bind_mouse().
the global value has been reset to nil in unbind_mouse(), we can retrieve value if the global value is determined to be nil in bind_mouse().

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

Successfully merging this pull request may close these issues.

3 participants