fix: only autohide UI when the cursor autohides #771
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 functioncursor: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()
incursor: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.