mirror of
https://github.com/swaywm/sway.git
synced 2025-11-13 13:29:49 -05:00
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.
This commit is contained in:
parent
024b9d85ea
commit
e787a1581c
4 changed files with 13 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue