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

fix: only autohide UI when the cursor autohides #771

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

christoph-heinrich
Copy link
Contributor

@christoph-heinrich christoph-heinrich commented Nov 4, 2023

The cursor isn't allowed to autohide while hovering elements, so the UI shouldn't autohide either. Otherwise this leads to the situation where the UI autohides while e.g. hovering the timeline, and then the cursor autohides afterwards because it's not hovering anything anymore.

The self.autohide_timer:kill() in function cursor:autohide() doesn't change anything functionality wise, but without it the timer keeps periodically moving the mouse to (inf, inf) which is unnecessary and annoying when debugging cursor position related stuff.

The self:queue_autohide() in cursor:decide_keybinds() is necessary because when e.g. the cursor moves 1px off of an element then during the position update there are still the bindings for that element, so UI autohide is prevented, but then on the next render there are no bindings anymore and the UI should autohide just like the cursor.

@tomasklaen
Copy link
Owner

Should we add cursor-autohide-fs-only check to :allow_autohide()?

And allow_autohide sounds like it's enabling autohide instead of just checking. Rename it to something like is_autohide_allowed.

The cursor isn't allowed to autohide while hovering elements, so the UI
shouldn't autohide either. Otherwise this leads to the situation where
the UI autohides while e.g. hovering the timeline, and then the
cursor autohides afterwards because it's not hovering anything anymore.
@christoph-heinrich
Copy link
Contributor Author

cursor-autohide-fs-only now gets observed and stored in cursor instead of state, because I thought it's not relevant to anything else.

cursor-autohide also gets observed now and updates the autohide time.

@tomasklaen tomasklaen merged commit c3e5bb2 into tomasklaen:main Nov 6, 2023
@christoph-heinrich christoph-heinrich deleted the fix_autohide_hover branch November 6, 2023 15:19
Uranite added a commit to Uranite/uosc that referenced this pull request Feb 3, 2024
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.

2 participants