Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
surface: handle hyperlinks more reliably
We refresh the link hover state in two (generic) cases 1. When the modifiers change 2. When the cursor changes position Each of these have additional state qualifiers. Modify the qualifiers such that we refresh links under the following scenarios: 1. Modifiers change - Control is pressed (this is handled in the renderer) - Mouse reporting is off OR Mouse reporting is on AND shift is pressed AND we are NOT reporting shift to the terminal 2. Cursor changes position - Control is pressed (this is handled in the renderer) - We previously were over a link - The position changed (or we had no previous position) - Mouse reporting is off OR Mouse reporting is on AND shift is pressed AND we are NOT reporting shift to the terminal This fixes a few issues with the previous implementation: 1. If mouse reporting was on and you were over a link, pressing ctrl would enable link hover state. If you moved your mouse, you would exit that state. The logic in the keyCallback and the cursorPosCallback was not the same. Now, they both check for the same set of conditions 2. If mouse reporting was off, you could hold control and move the mouse to discover links. If mouse reporting was on, holding control + shift would not allow you to discover links. You had to be hovering one when you pressed the modifiers. Previously, we only refreshed links if we *weren't* reporting the mouse event. Now, we refresh links even even if we report a mouse event (ie a mouse motion event with the shift modifier pressed *will* hover links and also report events)
- Loading branch information