Conversation
Related to #1547 Concretely, if you are highlighting a link and then release the modifier, the other surfaces will be notified of this change.
This fixes a longstanding piece of tech debt which caused all sorts of bugs. Instead of trying to jam cursorPosCallback into a modsChanged event we bring out the link refreshing into a dedicated method that is shared.
Contributor
Author
|
Note: the blurred split/window issue still exists on GTK. I don't know how to fix it there yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A couple improvements for hyperlinks:
First, hyperlink state (underline or not plus mouse shape) will change properly when pressing the modifier without having to move the mouse. This was a regression I didn't realize and it's now cleaned up.
Second, I learned about an API I didn't know about before on macOS which lets us get keyboard events without being part of the responder chain or having accessibility privileges (
NSEvent.addLocalEventMonitor) so we can use that to detect modifier key changes and propagate them to unfocused surfaces. This fixes a previous known issue I marked as "wontfix" where blurred splits/windows wouldn't update their hyperlink state until focused.Looking forward, I'm still not super happy with our mouse button or position management in
src/Surface.zig. It's extremely complicated, order dependent, etc. and not unit tested at all. The inputs to the structure are not conducive to unit testing. I want to consider an approach similar tosrc/input/KeyEncoder.zigbut for our mouse events so we can make it fully deterministic for testing. In the interest of improving things in the short term, I'm making this PR now, but want to consider this larger change for the future.