diff options
author | emersion <contact@emersion.fr> | 2018-07-17 23:04:55 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-17 23:04:55 +0100 |
commit | 03d49490ccff3c5c81bea73622c8616fa61eb3dd (patch) | |
tree | 36c00eec16f7501d8556c6d5c5a3e214d14ce4f0 | |
parent | Merge pull request #2289 from frsfnrrg/memory-fixes (diff) | |
download | sway-03d49490ccff3c5c81bea73622c8616fa61eb3dd.tar.gz sway-03d49490ccff3c5c81bea73622c8616fa61eb3dd.tar.zst sway-03d49490ccff3c5c81bea73622c8616fa61eb3dd.zip |
Update cursor on focus change
This allows to send wl_pointer.enter when switching between views
in a split/tabbed layout for instance. This (1) updates the cursor
image accordingly (2) makes it unnecessary to move the mouse before
scrolling. It's harmless to always call cursor_send_pointer_motion
because in case the focused surface hasn't changed this is a no-op.
The `last_focus != NULL` condition is required otherwise
cursor_send_pointer_motion will crash when sway starts up (the
sway_output doesn't yet have a workspace).
-rw-r--r-- | sway/input/seat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 12b1fab5..8ed4a3fe 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -738,7 +738,7 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
738 | } | 738 | } |
739 | } | 739 | } |
740 | 740 | ||
741 | if (last_workspace && last_workspace != new_workspace) { | 741 | if (last_focus != NULL) { |
742 | cursor_send_pointer_motion(seat->cursor, 0, true); | 742 | cursor_send_pointer_motion(seat->cursor, 0, true); |
743 | } | 743 | } |
744 | 744 | ||