diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-09-10 21:00:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 21:00:39 -0400 |
commit | 822b45f4836c9a22af5a283e2aea6e4ecd514c22 (patch) | |
tree | 8cf1710d23edfe1da01da72338197b348288922d /sway/commands | |
parent | 024b9d85ea4cd51d803317c64e46dac659c9f7ec (diff) | |
parent | 097ed036477b775624593ac95fdaef12c36ff306 (diff) |
Merge pull request #2617 from wmww/cursor-enter-on-focus-change
Give windows pointer focus immediately
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/focus.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 668a0c7b..d63077e6 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -3,6 +3,7 @@ #include "log.h" #include "sway/commands.h" #include "sway/input/input-manager.h" +#include "sway/input/cursor.h" #include "sway/input/seat.h" #include "sway/output.h" #include "sway/tree/arrange.h" @@ -180,6 +181,7 @@ static struct cmd_results *focus_mode(struct sway_workspace *ws, } if (new_focus) { seat_set_focus_container(seat, new_focus); + cursor_send_pointer_motion(seat->cursor, 0, true); } else { return cmd_results_new(CMD_FAILURE, "focus", "Failed to find a %s container in workspace", @@ -212,6 +214,7 @@ static struct cmd_results *focus_output(struct sway_seat *seat, free(identifier); if (output) { seat_set_focus(seat, seat_get_focus_inactive(seat, &output->node)); + cursor_send_pointer_motion(seat->cursor, 0, true); } return cmd_results_new(CMD_SUCCESS, NULL, NULL); @@ -232,6 +235,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { if (argc == 0 && container) { seat_set_focus_container(seat, container); + cursor_send_pointer_motion(seat->cursor, 0, true); return cmd_results_new(CMD_SUCCESS, NULL, NULL); } @@ -260,6 +264,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { struct sway_node *focus = seat_get_active_child(seat, node); if (focus) { seat_set_focus(seat, focus); + cursor_send_pointer_motion(seat->cursor, 0, true); } return cmd_results_new(CMD_SUCCESS, NULL, NULL); } @@ -279,6 +284,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { struct sway_node *node = get_node_in_output_direction(new_output, direction); seat_set_focus(seat, node); + cursor_send_pointer_motion(seat->cursor, 0, true); return cmd_results_new(CMD_SUCCESS, NULL, NULL); } @@ -286,6 +292,7 @@ struct cmd_results *cmd_focus(int argc, char **argv) { node_get_in_direction(container, seat, direction); if (next_focus) { seat_set_focus(seat, next_focus); + cursor_send_pointer_motion(seat->cursor, 0, true); } return cmd_results_new(CMD_SUCCESS, NULL, NULL); |