aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar William Wold <wm@wmww.sh>2018-09-09 22:47:58 -0700
committerLibravatar William Wold <wm@wmww.sh>2018-09-10 10:18:12 -0700
commite787a1581cc399ca7d953c9cd4d868499f5733a3 (patch)
tree3f14ab74cc6684867cdf41de76e0b833ad86783f /sway/tree/workspace.c
parentMerge pull request #2613 from apreiml/fix_no_last_focus_fail (diff)
downloadsway-e787a1581cc399ca7d953c9cd4d868499f5733a3.tar.gz
sway-e787a1581cc399ca7d953c9cd4d868499f5733a3.tar.zst
sway-e787a1581cc399ca7d953c9cd4d868499f5733a3.zip
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.c3
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 @@
7#include <strings.h> 7#include <strings.h>
8#include "stringop.h" 8#include "stringop.h"
9#include "sway/input/input-manager.h" 9#include "sway/input/input-manager.h"
10#include "sway/input/cursor.h"
10#include "sway/input/seat.h" 11#include "sway/input/seat.h"
11#include "sway/ipc-server.h" 12#include "sway/ipc-server.h"
12#include "sway/output.h" 13#include "sway/output.h"
@@ -400,6 +401,7 @@ bool workspace_switch(struct sway_workspace *workspace,
400 if (&floater->node == focus) { 401 if (&floater->node == focus) {
401 seat_set_focus(seat, NULL); 402 seat_set_focus(seat, NULL);
402 seat_set_focus_container(seat, floater); 403 seat_set_focus_container(seat, floater);
404 cursor_send_pointer_motion(seat->cursor, 0, true);
403 } 405 }
404 --i; 406 --i;
405 } 407 }
@@ -422,6 +424,7 @@ bool workspace_switch(struct sway_workspace *workspace,
422 } 424 }
423 seat_set_focus(seat, next); 425 seat_set_focus(seat, next);
424 arrange_workspace(workspace); 426 arrange_workspace(workspace);
427 cursor_send_pointer_motion(seat->cursor, 0, true);
425 return true; 428 return true;
426} 429}
427 430