diff options
author | Simon Ser <contact@emersion.fr> | 2023-12-04 15:56:54 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-12-13 10:11:35 +0100 |
commit | 607b8aed0c93a9101d9075b9c76e80460b6ed488 (patch) | |
tree | cc7a07f910378334ddd0879aaed85cd5d76aeb16 | |
parent | input/{keyboard,switch}: rename input_inhibited variable to locked (diff) | |
download | sway-607b8aed0c93a9101d9075b9c76e80460b6ed488.tar.gz sway-607b8aed0c93a9101d9075b9c76e80460b6ed488.tar.zst sway-607b8aed0c93a9101d9075b9c76e80460b6ed488.zip |
input/seat: inline seat_set_exclusive_client() with NULL client
-rw-r--r-- | sway/input/seat.c | 9 | ||||
-rw-r--r-- | sway/lock.c | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 3ef0d713..b269a4cd 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1371,15 +1371,6 @@ void seat_set_focus_layer(struct sway_seat *seat, | |||
1371 | 1371 | ||
1372 | void seat_set_exclusive_client(struct sway_seat *seat, | 1372 | void seat_set_exclusive_client(struct sway_seat *seat, |
1373 | struct wl_client *client) { | 1373 | struct wl_client *client) { |
1374 | if (!client) { | ||
1375 | // Triggers a refocus of the topmost surface layer if necessary | ||
1376 | // TODO: Make layer surface focus per-output based on cursor position | ||
1377 | for (int i = 0; i < root->outputs->length; ++i) { | ||
1378 | struct sway_output *output = root->outputs->items[i]; | ||
1379 | arrange_layers(output); | ||
1380 | } | ||
1381 | return; | ||
1382 | } | ||
1383 | if (seat->focused_layer) { | 1374 | if (seat->focused_layer) { |
1384 | if (wl_resource_get_client(seat->focused_layer->resource) != client) { | 1375 | if (wl_resource_get_client(seat->focused_layer->resource) != client) { |
1385 | seat_set_focus_layer(seat, NULL); | 1376 | seat_set_focus_layer(seat, NULL); |
diff --git a/sway/lock.c b/sway/lock.c index 6e279a51..ec2a7695 100644 --- a/sway/lock.c +++ b/sway/lock.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include "sway/input/cursor.h" | 4 | #include "sway/input/cursor.h" |
5 | #include "sway/input/keyboard.h" | 5 | #include "sway/input/keyboard.h" |
6 | #include "sway/input/seat.h" | 6 | #include "sway/input/seat.h" |
7 | #include "sway/layers.h" | ||
7 | #include "sway/output.h" | 8 | #include "sway/output.h" |
8 | #include "sway/server.h" | 9 | #include "sway/server.h" |
9 | #include "sway/surface.h" | 10 | #include "sway/surface.h" |
@@ -129,7 +130,6 @@ static void handle_unlock(struct wl_listener *listener, void *data) { | |||
129 | 130 | ||
130 | struct sway_seat *seat; | 131 | struct sway_seat *seat; |
131 | wl_list_for_each(seat, &server.input->seats, link) { | 132 | wl_list_for_each(seat, &server.input->seats, link) { |
132 | seat_set_exclusive_client(seat, NULL); | ||
133 | // copied from seat_set_focus_layer -- deduplicate? | 133 | // copied from seat_set_focus_layer -- deduplicate? |
134 | struct sway_node *previous = seat_get_focus_inactive(seat, &root->node); | 134 | struct sway_node *previous = seat_get_focus_inactive(seat, &root->node); |
135 | if (previous) { | 135 | if (previous) { |
@@ -139,6 +139,13 @@ static void handle_unlock(struct wl_listener *listener, void *data) { | |||
139 | } | 139 | } |
140 | } | 140 | } |
141 | 141 | ||
142 | // Triggers a refocus of the topmost surface layer if necessary | ||
143 | // TODO: Make layer surface focus per-output based on cursor position | ||
144 | for (int i = 0; i < root->outputs->length; ++i) { | ||
145 | struct sway_output *output = root->outputs->items[i]; | ||
146 | arrange_layers(output); | ||
147 | } | ||
148 | |||
142 | // redraw everything | 149 | // redraw everything |
143 | for (int i = 0; i < root->outputs->length; ++i) { | 150 | for (int i = 0; i < root->outputs->length; ++i) { |
144 | struct sway_output *output = root->outputs->items[i]; | 151 | struct sway_output *output = root->outputs->items[i]; |