aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-02 11:44:42 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-02 11:44:42 -0400
commita82c107c7613548a3ae0e75bb951ba57b7d2f22b (patch)
treec98359e87642355925dc1dda415aeebb1a01e071 /sway/input/seat.c
parentdont copy seat config on the seat (diff)
downloadsway-a82c107c7613548a3ae0e75bb951ba57b7d2f22b.tar.gz
sway-a82c107c7613548a3ae0e75bb951ba57b7d2f22b.tar.zst
sway-a82c107c7613548a3ae0e75bb951ba57b7d2f22b.zip
80col
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 91a9e32b..38b617b7 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -49,7 +49,8 @@ static void handle_seat_container_destroy(struct wl_listener *listener,
49 if (is_focus) { 49 if (is_focus) {
50 // pick next focus 50 // pick next focus
51 seat_set_focus(seat, NULL); 51 seat_set_focus(seat, NULL);
52 struct sway_container *next = seat_get_focus_inactive(seat, con->parent); 52 struct sway_container *next =
53 seat_get_focus_inactive(seat, con->parent);
53 if (next == NULL) { 54 if (next == NULL) {
54 next = con->parent; 55 next = con->parent;
55 } 56 }
@@ -133,7 +134,8 @@ struct sway_seat *seat_create(struct sway_input_manager *input,
133 // init the focus stack 134 // init the focus stack
134 wl_list_init(&seat->focus_stack); 135 wl_list_init(&seat->focus_stack);
135 136
136 container_for_each_descendant_dfs(&root_container, collect_focus_iter, seat); 137 container_for_each_descendant_dfs(&root_container,
138 collect_focus_iter, seat);
137 139
138 wl_signal_add(&root_container.sway_root->events.new_container, 140 wl_signal_add(&root_container.sway_root->events.new_container,
139 &seat->new_container); 141 &seat->new_container);
@@ -165,7 +167,8 @@ static void seat_configure_keyboard(struct sway_seat *seat,
165 if (!seat_device->keyboard) { 167 if (!seat_device->keyboard) {
166 sway_keyboard_create(seat, seat_device); 168 sway_keyboard_create(seat, seat_device);
167 } 169 }
168 struct wlr_keyboard *wlr_keyboard = seat_device->input_device->wlr_device->keyboard; 170 struct wlr_keyboard *wlr_keyboard =
171 seat_device->input_device->wlr_device->keyboard;
169 sway_keyboard_configure(seat_device->keyboard); 172 sway_keyboard_configure(seat_device->keyboard);
170 wlr_seat_set_keyboard(seat->wlr_seat, 173 wlr_seat_set_keyboard(seat->wlr_seat,
171 seat_device->input_device->wlr_device); 174 seat_device->input_device->wlr_device);
@@ -275,7 +278,8 @@ void seat_configure_xcursor(struct sway_seat *seat) {
275 } 278 }
276 279
277 for (int i = 0; i < root_container.children->length; ++i) { 280 for (int i = 0; i < root_container.children->length; ++i) {
278 struct sway_container *output_container = root_container.children->items[i]; 281 struct sway_container *output_container =
282 root_container.children->items[i];
279 struct wlr_output *output = 283 struct wlr_output *output =
280 output_container->sway_output->wlr_output; 284 output_container->sway_output->wlr_output;
281 bool result = 285 bool result =
@@ -379,7 +383,8 @@ void seat_set_focus(struct sway_seat *seat,
379 seat_set_focus_warp(seat, container, true); 383 seat_set_focus_warp(seat, container, true);
380} 384}
381 385
382struct sway_container *seat_get_focus_inactive(struct sway_seat *seat, struct sway_container *container) { 386struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
387 struct sway_container *container) {
383 struct sway_seat_container *current = NULL; 388 struct sway_seat_container *current = NULL;
384 struct sway_container *parent = NULL; 389 struct sway_container *parent = NULL;
385 wl_list_for_each(current, &seat->focus_stack, link) { 390 wl_list_for_each(current, &seat->focus_stack, link) {
@@ -409,7 +414,8 @@ struct sway_container *seat_get_focus(struct sway_seat *seat) {
409 414
410struct sway_container *seat_get_focus_by_type(struct sway_seat *seat, 415struct sway_container *seat_get_focus_by_type(struct sway_seat *seat,
411 enum sway_container_type type) { 416 enum sway_container_type type) {
412 struct sway_container *focus = seat_get_focus_inactive(seat, &root_container); 417 struct sway_container *focus =
418 seat_get_focus_inactive(seat, &root_container);
413 if (focus->type == type) { 419 if (focus->type == type) {
414 return focus; 420 return focus;
415 } 421 }