aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-12-04 15:56:54 +0100
committerSimon Ser <contact@emersion.fr>2023-12-13 10:11:35 +0100
commit607b8aed0c93a9101d9075b9c76e80460b6ed488 (patch)
treecc7a07f910378334ddd0879aaed85cd5d76aeb16
parent7ad8c80bfe020f2689b049306f5c0a6fe6ff622d (diff)
input/seat: inline seat_set_exclusive_client() with NULL client
-rw-r--r--sway/input/seat.c9
-rw-r--r--sway/lock.c9
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,
void seat_set_exclusive_client(struct sway_seat *seat,
struct wl_client *client) {
- if (!client) {
- // Triggers a refocus of the topmost surface layer if necessary
- // TODO: Make layer surface focus per-output based on cursor position
- for (int i = 0; i < root->outputs->length; ++i) {
- struct sway_output *output = root->outputs->items[i];
- arrange_layers(output);
- }
- return;
- }
if (seat->focused_layer) {
if (wl_resource_get_client(seat->focused_layer->resource) != client) {
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 @@
#include "sway/input/cursor.h"
#include "sway/input/keyboard.h"
#include "sway/input/seat.h"
+#include "sway/layers.h"
#include "sway/output.h"
#include "sway/server.h"
#include "sway/surface.h"
@@ -129,7 +130,6 @@ static void handle_unlock(struct wl_listener *listener, void *data) {
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
- seat_set_exclusive_client(seat, NULL);
// copied from seat_set_focus_layer -- deduplicate?
struct sway_node *previous = seat_get_focus_inactive(seat, &root->node);
if (previous) {
@@ -139,6 +139,13 @@ static void handle_unlock(struct wl_listener *listener, void *data) {
}
}
+ // Triggers a refocus of the topmost surface layer if necessary
+ // TODO: Make layer surface focus per-output based on cursor position
+ for (int i = 0; i < root->outputs->length; ++i) {
+ struct sway_output *output = root->outputs->items[i];
+ arrange_layers(output);
+ }
+
// redraw everything
for (int i = 0; i < root->outputs->length; ++i) {
struct sway_output *output = root->outputs->items[i];