diff options
author | William Wold <wm@wmww.sh> | 2018-09-09 22:47:58 -0700 |
---|---|---|
committer | William Wold <wm@wmww.sh> | 2018-09-10 10:18:12 -0700 |
commit | e787a1581cc399ca7d953c9cd4d868499f5733a3 (patch) | |
tree | 3f14ab74cc6684867cdf41de76e0b833ad86783f /sway/tree/workspace.c | |
parent | 024b9d85ea4cd51d803317c64e46dac659c9f7ec (diff) |
Give windows pointer focus immediately when they are switched to
Fixes #2401 (aka #2558)
Previously, when switching windows, pointer focus was not changed until the pointer was moved. This makes the pointer enter happen immediately, without the side effects of other attempted fixes.
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 378bfc5d..b8e90892 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -7,6 +7,7 @@ #include <strings.h> #include "stringop.h" #include "sway/input/input-manager.h" +#include "sway/input/cursor.h" #include "sway/input/seat.h" #include "sway/ipc-server.h" #include "sway/output.h" @@ -400,6 +401,7 @@ bool workspace_switch(struct sway_workspace *workspace, if (&floater->node == focus) { seat_set_focus(seat, NULL); seat_set_focus_container(seat, floater); + cursor_send_pointer_motion(seat->cursor, 0, true); } --i; } @@ -422,6 +424,7 @@ bool workspace_switch(struct sway_workspace *workspace, } seat_set_focus(seat, next); arrange_workspace(workspace); + cursor_send_pointer_motion(seat->cursor, 0, true); return true; } |