aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2024-01-18 10:04:26 -0500
committerKirill Primak <vyivel@eclair.cafe>2024-01-18 18:36:54 +0300
commit9a579666068d62b9354a39941e1ac8c1f4a58093 (patch)
tree79d5d36f27b43f1d68969242211a0e01395c6bfc /sway/input
parent0639bde9fb5637fbe63c65bfe85660745f159b96 (diff)
scene_graph: Port ext_session_v1
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c18
-rw-r--r--sway/input/keyboard.c2
-rw-r--r--sway/input/seat.c19
-rw-r--r--sway/input/switch.c2
4 files changed, 7 insertions, 34 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index e8604193..107424c9 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -95,24 +95,6 @@ struct sway_node *node_at_coords(
double ox = lx, oy = ly;
wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy);
- if (server.session_lock.locked) {
- if (server.session_lock.lock == NULL) {
- return NULL;
- }
- struct wlr_session_lock_surface_v1 *lock_surf;
- wl_list_for_each(lock_surf, &server.session_lock.lock->surfaces, link) {
- if (lock_surf->output != wlr_output) {
- continue;
- }
-
- *surface = wlr_surface_surface_at(lock_surf->surface, ox, oy, sx, sy);
- if (*surface != NULL) {
- return NULL;
- }
- }
- return NULL;
- }
-
// layer surfaces on the overlay layer are rendered on top
if ((*surface = layer_surface_at(output,
&output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index dea7a7bd..b97f0152 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -405,7 +405,7 @@ static void handle_key_event(struct sway_keyboard *keyboard,
char *device_identifier = input_device_get_identifier(wlr_device);
bool exact_identifier = keyboard->wlr->group != NULL;
seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD);
- bool locked = server.session_lock.locked;
+ bool locked = server.session_lock.lock;
struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor =
keyboard_shortcuts_inhibitor_get_for_focused_surface(seat);
bool shortcuts_inhibited = sway_inhibitor && sway_inhibitor->inhibitor->active;
diff --git a/sway/input/seat.c b/sway/input/seat.c
index d2cd1ba4..b8daa297 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1060,19 +1060,10 @@ void seat_configure_xcursor(struct sway_seat *seat) {
bool seat_is_input_allowed(struct sway_seat *seat,
struct wlr_surface *surface) {
- if (!server.session_lock.locked) {
- return true;
- }
- if (server.session_lock.lock == NULL) {
- return false;
- }
- struct wlr_session_lock_surface_v1 *lock_surf;
- wl_list_for_each(lock_surf, &server.session_lock.lock->surfaces, link) {
- if (lock_surf->surface == surface) {
- return true;
- }
+ if (server.session_lock.lock) {
+ return sway_session_lock_has_surface(server.session_lock.lock, surface);
}
- return false;
+ return true;
}
static void send_unfocus(struct sway_container *con, void *data) {
@@ -1277,8 +1268,8 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
} else {
seat_set_workspace_focus(seat, node);
}
- if (server.session_lock.locked) {
- seat_set_focus_surface(seat, server.session_lock.focused, false);
+ if (server.session_lock.lock) {
+ seat_set_focus_surface(seat, server.session_lock.lock->focused, false);
}
}
diff --git a/sway/input/switch.c b/sway/input/switch.c
index f483cd23..831f4dbf 100644
--- a/sway/input/switch.c
+++ b/sway/input/switch.c
@@ -34,7 +34,7 @@ static bool sway_switch_trigger_test(enum sway_switch_trigger trigger,
static void execute_binding(struct sway_switch *sway_switch) {
struct sway_seat *seat = sway_switch->seat_device->sway_seat;
- bool locked = server.session_lock.locked;
+ bool locked = server.session_lock.lock;
list_t *bindings = config->current_mode->switch_bindings;
struct sway_switch_binding *matched_binding = NULL;