diff options
author | Simon Ser <contact@emersion.fr> | 2023-01-16 19:12:33 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-02-10 18:12:27 +0100 |
commit | 3696060549c24fc667779d04b184db5e398b573c (patch) | |
tree | b7fd9a783dee213a0f0d9e461c7a05a21ac5cbc2 | |
parent | Send wl_surface.enter for ext-session-lock surfaces (diff) | |
download | sway-3696060549c24fc667779d04b184db5e398b573c.tar.gz sway-3696060549c24fc667779d04b184db5e398b573c.tar.zst sway-3696060549c24fc667779d04b184db5e398b573c.zip |
Fix pointer events for ext-session-lock surfaces
We were never sending any pointer event to ext-session-lock
surfaces.
(cherry picked from commit 6a3e265326fab11b8f68374c9f30410f647ae866)
-rw-r--r-- | sway/input/cursor.c | 18 | ||||
-rw-r--r-- | sway/input/seat.c | 15 |
2 files changed, 31 insertions, 2 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 9d83008f..a5f1204b 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -97,6 +97,24 @@ struct sway_node *node_at_coords( | |||
97 | double ox = lx, oy = ly; | 97 | double ox = lx, oy = ly; |
98 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); | 98 | wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); |
99 | 99 | ||
100 | if (server.session_lock.locked) { | ||
101 | if (server.session_lock.lock == NULL) { | ||
102 | return NULL; | ||
103 | } | ||
104 | struct wlr_session_lock_surface_v1 *lock_surf; | ||
105 | wl_list_for_each(lock_surf, &server.session_lock.lock->surfaces, link) { | ||
106 | if (lock_surf->output != wlr_output) { | ||
107 | continue; | ||
108 | } | ||
109 | |||
110 | *surface = wlr_surface_surface_at(lock_surf->surface, ox, oy, sx, sy); | ||
111 | if (*surface != NULL) { | ||
112 | return NULL; | ||
113 | } | ||
114 | } | ||
115 | return NULL; | ||
116 | } | ||
117 | |||
100 | // layer surfaces on the overlay layer are rendered on top | 118 | // layer surfaces on the overlay layer are rendered on top |
101 | if ((*surface = layer_surface_at(output, | 119 | if ((*surface = layer_surface_at(output, |
102 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], | 120 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 0bd33581..28210bb5 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -1080,9 +1080,20 @@ void seat_configure_xcursor(struct sway_seat *seat) { | |||
1080 | 1080 | ||
1081 | bool seat_is_input_allowed(struct sway_seat *seat, | 1081 | bool seat_is_input_allowed(struct sway_seat *seat, |
1082 | struct wlr_surface *surface) { | 1082 | struct wlr_surface *surface) { |
1083 | if (server.session_lock.locked) { | ||
1084 | if (server.session_lock.lock == NULL) { | ||
1085 | return false; | ||
1086 | } | ||
1087 | struct wlr_session_lock_surface_v1 *lock_surf; | ||
1088 | wl_list_for_each(lock_surf, &server.session_lock.lock->surfaces, link) { | ||
1089 | if (lock_surf->surface == surface) { | ||
1090 | return true; | ||
1091 | } | ||
1092 | } | ||
1093 | return false; | ||
1094 | } | ||
1083 | struct wl_client *client = wl_resource_get_client(surface->resource); | 1095 | struct wl_client *client = wl_resource_get_client(surface->resource); |
1084 | return seat->exclusive_client == client || | 1096 | return seat->exclusive_client == client || seat->exclusive_client == NULL; |
1085 | (seat->exclusive_client == NULL && !server.session_lock.locked); | ||
1086 | } | 1097 | } |
1087 | 1098 | ||
1088 | static void send_unfocus(struct sway_container *con, void *data) { | 1099 | static void send_unfocus(struct sway_container *con, void *data) { |