aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-01-21 23:46:44 -0500
committerLibravatar emersion <contact@emersion.fr>2019-01-22 09:33:58 +0100
commitab0248a54564b2f644b6fb367f9eb44fe0bf5f3c (patch)
tree67899b5c7967c33b81c71a0e6f8df034078a29dd /sway/input/seat.c
parentswaynag: Small graphical fix, add offset of +1 to X/Y. (diff)
downloadsway-ab0248a54564b2f644b6fb367f9eb44fe0bf5f3c.tar.gz
sway-ab0248a54564b2f644b6fb367f9eb44fe0bf5f3c.tar.zst
sway-ab0248a54564b2f644b6fb367f9eb44fe0bf5f3c.zip
seat_create: set initial focus for added seats
This sets the initial focus for all seats other than the first seat, which gets it focus on launch. The ensures that all seats have something focused.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 82e0e754..1a4ccd77 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -357,6 +357,14 @@ struct sway_seat *seat_create(const char *seat_name) {
357 root_for_each_workspace(collect_focus_workspace_iter, seat); 357 root_for_each_workspace(collect_focus_workspace_iter, seat);
358 root_for_each_container(collect_focus_container_iter, seat); 358 root_for_each_container(collect_focus_container_iter, seat);
359 359
360 if (!wl_list_empty(&server.input->seats)) {
361 // Since this is not the first seat, attempt to set initial focus
362 struct sway_seat *current_seat = input_manager_current_seat();
363 struct sway_node *current_focus =
364 seat_get_focus_inactive(current_seat, &root->node);
365 seat_set_focus(seat, current_focus);
366 }
367
360 wl_signal_add(&root->events.new_node, &seat->new_node); 368 wl_signal_add(&root->events.new_node, &seat->new_node);
361 seat->new_node.notify = handle_new_node; 369 seat->new_node.notify = handle_new_node;
362 370