aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorDaniel De Graaf <code@danieldg.net>2022-03-08 21:14:26 -0500
committerSimon Ser <contact@emersion.fr>2022-04-29 09:06:36 +0200
commit519038a7e903caae731007b276f5666a341498e9 (patch)
treeb62cb6728503c5e0940c08bb8cb30b81aab9e830 /sway/desktop/output.c
parent70d30ac72b93c19813f6574025fb4723845ed6a4 (diff)
Implement ext-session-lock-v1
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index dd2eaf08..18367a1c 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -275,6 +275,25 @@ static void for_each_surface_container_iterator(struct sway_container *con,
static void output_for_each_surface(struct sway_output *output,
sway_surface_iterator_func_t iterator, void *user_data) {
+ if (server.session_lock.locked) {
+ if (server.session_lock.lock == NULL) {
+ return;
+ }
+ struct wlr_session_lock_surface_v1 *lock_surface;
+ wl_list_for_each(lock_surface, &server.session_lock.lock->surfaces, link) {
+ if (lock_surface->output != output->wlr_output) {
+ continue;
+ }
+ if (!lock_surface->mapped) {
+ continue;
+ }
+
+ output_surface_for_each_surface(output, lock_surface->surface,
+ 0.0, 0.0, iterator, user_data);
+ }
+ return;
+ }
+
if (output_has_opaque_overlay_layer_surface(output)) {
goto overlay;
}