Commit 006b095
authored
MouseFollowsFocus: avoid getting the mouse stuck in screen corners (#335)
The mouse cursor moves in a straight line between its current position
and the destination set with hs.mouse.absolutePosition(). If the mouse
is moving to a new screen, it can get caught on a corner that does not
connect between screens, depending on the screen sizes and layout.
When moving the mouse between screens, first move the mouse to the
center of the current screen, then to the center of the new screen, then
the target destination. This path has the best chance at avoiding any
non-connected edges between screens.
These extra mouse movements happen instantaneously and are not visible
to the user.1 parent 63aa8a1 commit 006b095
File tree
2 files changed
+8
-1
lines changed- Source/MouseFollowsFocus.spoon
- Spoons
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
| |||
Binary file not shown.
0 commit comments