aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2023-11-22 00:49:23 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2023-12-13 10:11:35 +0100
commitdbd70faf2e0a8115f681995801fd4b82f4682604 (patch)
treef9c5f8dbf55396f1d7df172bf57386e13a3ce2f7
parentDetect proprietary DisplayLink drivers (diff)
downloadsway-dbd70faf2e0a8115f681995801fd4b82f4682604.tar.gz
sway-dbd70faf2e0a8115f681995801fd4b82f4682604.tar.zst
sway-dbd70faf2e0a8115f681995801fd4b82f4682604.zip
input/seat: drop exclusive_client
This was a input-inhibit concept.
-rw-r--r--include/sway/input/seat.h3
-rw-r--r--sway/desktop/layer_shell.c3
-rw-r--r--sway/input/keyboard.c3
-rw-r--r--sway/input/seat.c5
-rw-r--r--sway/input/switch.c3
-rw-r--r--sway/lock.c5
6 files changed, 4 insertions, 18 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 97e81c19..a6c68fb8 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -108,9 +108,6 @@ struct sway_seat {
108 // If the exclusive layer is set, views cannot receive keyboard focus 108 // If the exclusive layer is set, views cannot receive keyboard focus
109 bool has_exclusive_layer; 109 bool has_exclusive_layer;
110 110
111 // If exclusive_client is set, no other clients will receive input events
112 struct wl_client *exclusive_client;
113
114 // Last touch point 111 // Last touch point
115 int32_t touch_id; 112 int32_t touch_id;
116 double touch_x, touch_y; 113 double touch_x, touch_y;
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 979c4449..31d8558c 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -305,9 +305,8 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) {
305 struct sway_seat *seat = input_manager_get_default_seat(); 305 struct sway_seat *seat = input_manager_get_default_seat();
306 struct wl_client *client = 306 struct wl_client *client =
307 wl_resource_get_client(sway_layer->layer_surface->resource); 307 wl_resource_get_client(sway_layer->layer_surface->resource);
308 bool set_focus = seat->exclusive_client == client;
309 308
310 if (set_focus) { 309 if (!server.session_lock.locked) {
311 struct sway_layer_surface *layer = 310 struct sway_layer_surface *layer =
312 find_mapped_layer_by_client(client, sway_layer->layer_surface->output); 311 find_mapped_layer_by_client(client, sway_layer->layer_surface->output);
313 if (layer) { 312 if (layer) {
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 8927287f..577ec9f5 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -405,8 +405,7 @@ static void handle_key_event(struct sway_keyboard *keyboard,
405 char *device_identifier = input_device_get_identifier(wlr_device); 405 char *device_identifier = input_device_get_identifier(wlr_device);
406 bool exact_identifier = keyboard->wlr->group != NULL; 406 bool exact_identifier = keyboard->wlr->group != NULL;
407 seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD); 407 seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD);
408 bool input_inhibited = seat->exclusive_client != NULL || 408 bool input_inhibited = server.session_lock.locked;
409 server.session_lock.locked;
410 struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor = 409 struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor =
411 keyboard_shortcuts_inhibitor_get_for_focused_surface(seat); 410 keyboard_shortcuts_inhibitor_get_for_focused_surface(seat);
412 bool shortcuts_inhibited = sway_inhibitor && sway_inhibitor->inhibitor->active; 411 bool shortcuts_inhibited = sway_inhibitor && sway_inhibitor->inhibitor->active;
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 0fd0e8e6..3ef0d713 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1104,8 +1104,7 @@ bool seat_is_input_allowed(struct sway_seat *seat,
1104 } 1104 }
1105 return false; 1105 return false;
1106 } 1106 }
1107 struct wl_client *client = wl_resource_get_client(surface->resource); 1107 return true;
1108 return seat->exclusive_client == client || seat->exclusive_client == NULL;
1109} 1108}
1110 1109
1111static void send_unfocus(struct sway_container *con, void *data) { 1110static void send_unfocus(struct sway_container *con, void *data) {
@@ -1373,7 +1372,6 @@ void seat_set_focus_layer(struct sway_seat *seat,
1373void seat_set_exclusive_client(struct sway_seat *seat, 1372void seat_set_exclusive_client(struct sway_seat *seat,
1374 struct wl_client *client) { 1373 struct wl_client *client) {
1375 if (!client) { 1374 if (!client) {
1376 seat->exclusive_client = client;
1377 // Triggers a refocus of the topmost surface layer if necessary 1375 // Triggers a refocus of the topmost surface layer if necessary
1378 // TODO: Make layer surface focus per-output based on cursor position 1376 // TODO: Make layer surface focus per-output based on cursor position
1379 for (int i = 0; i < root->outputs->length; ++i) { 1377 for (int i = 0; i < root->outputs->length; ++i) {
@@ -1408,7 +1406,6 @@ void seat_set_exclusive_client(struct sway_seat *seat,
1408 now.tv_nsec / 1000, point->touch_id); 1406 now.tv_nsec / 1000, point->touch_id);
1409 } 1407 }
1410 } 1408 }
1411 seat->exclusive_client = client;
1412} 1409}
1413 1410
1414struct sway_node *seat_get_focus_inactive(struct sway_seat *seat, 1411struct sway_node *seat_get_focus_inactive(struct sway_seat *seat,
diff --git a/sway/input/switch.c b/sway/input/switch.c
index 7a539801..32d9c7e0 100644
--- a/sway/input/switch.c
+++ b/sway/input/switch.c
@@ -34,8 +34,7 @@ static bool sway_switch_trigger_test(enum sway_switch_trigger trigger,
34 34
35static void execute_binding(struct sway_switch *sway_switch) { 35static void execute_binding(struct sway_switch *sway_switch) {
36 struct sway_seat* seat = sway_switch->seat_device->sway_seat; 36 struct sway_seat* seat = sway_switch->seat_device->sway_seat;
37 bool input_inhibited = seat->exclusive_client != NULL || 37 bool input_inhibited = server.session_lock.locked;
38 server.session_lock.locked;
39 38
40 list_t *bindings = config->current_mode->switch_bindings; 39 list_t *bindings = config->current_mode->switch_bindings;
41 struct sway_switch_binding *matched_binding = NULL; 40 struct sway_switch_binding *matched_binding = NULL;
diff --git a/sway/lock.c b/sway/lock.c
index 199624fc..6e279a51 100644
--- a/sway/lock.c
+++ b/sway/lock.c
@@ -155,11 +155,6 @@ static void handle_abandon(struct wl_listener *listener, void *data) {
155 wl_list_remove(&server.session_lock.lock_unlock.link); 155 wl_list_remove(&server.session_lock.lock_unlock.link);
156 wl_list_remove(&server.session_lock.lock_destroy.link); 156 wl_list_remove(&server.session_lock.lock_destroy.link);
157 157
158 struct sway_seat *seat;
159 wl_list_for_each(seat, &server.input->seats, link) {
160 seat->exclusive_client = NULL;
161 }
162
163 // redraw everything 158 // redraw everything
164 for (int i = 0; i < root->outputs->length; ++i) { 159 for (int i = 0; i < root->outputs->length; ++i) {
165 struct sway_output *output = root->outputs->items[i]; 160 struct sway_output *output = root->outputs->items[i];