diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 19 | ||||
-rw-r--r-- | sway/desktop/render.c | 35 |
2 files changed, 54 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, | |||
275 | 275 | ||
276 | static void output_for_each_surface(struct sway_output *output, | 276 | static void output_for_each_surface(struct sway_output *output, |
277 | sway_surface_iterator_func_t iterator, void *user_data) { | 277 | sway_surface_iterator_func_t iterator, void *user_data) { |
278 | if (server.session_lock.locked) { | ||
279 | if (server.session_lock.lock == NULL) { | ||
280 | return; | ||
281 | } | ||
282 | struct wlr_session_lock_surface_v1 *lock_surface; | ||
283 | wl_list_for_each(lock_surface, &server.session_lock.lock->surfaces, link) { | ||
284 | if (lock_surface->output != output->wlr_output) { | ||
285 | continue; | ||
286 | } | ||
287 | if (!lock_surface->mapped) { | ||
288 | continue; | ||
289 | } | ||
290 | |||
291 | output_surface_for_each_surface(output, lock_surface->surface, | ||
292 | 0.0, 0.0, iterator, user_data); | ||
293 | } | ||
294 | return; | ||
295 | } | ||
296 | |||
278 | if (output_has_opaque_overlay_layer_surface(output)) { | 297 | if (output_has_opaque_overlay_layer_surface(output)) { |
279 | goto overlay; | 298 | goto overlay; |
280 | } | 299 | } |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 02397c05..ed9ad490 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -1056,6 +1056,41 @@ void output_render(struct sway_output *output, struct timespec *when, | |||
1056 | wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1}); | 1056 | wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1}); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | if (server.session_lock.locked) { | ||
1060 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; | ||
1061 | if (server.session_lock.lock == NULL) { | ||
1062 | // abandoned lock -> red BG | ||
1063 | clear_color[0] = 1.f; | ||
1064 | } | ||
1065 | int nrects; | ||
1066 | pixman_box32_t *rects = pixman_region32_rectangles(damage, &nrects); | ||
1067 | for (int i = 0; i < nrects; ++i) { | ||
1068 | scissor_output(wlr_output, &rects[i]); | ||
1069 | wlr_renderer_clear(renderer, clear_color); | ||
1070 | } | ||
1071 | |||
1072 | if (server.session_lock.lock != NULL) { | ||
1073 | struct render_data data = { | ||
1074 | .damage = damage, | ||
1075 | .alpha = 1.0f, | ||
1076 | }; | ||
1077 | |||
1078 | struct wlr_session_lock_surface_v1 *lock_surface; | ||
1079 | wl_list_for_each(lock_surface, &server.session_lock.lock->surfaces, link) { | ||
1080 | if (lock_surface->output != wlr_output) { | ||
1081 | continue; | ||
1082 | } | ||
1083 | if (!lock_surface->mapped) { | ||
1084 | continue; | ||
1085 | } | ||
1086 | |||
1087 | output_surface_for_each_surface(output, lock_surface->surface, | ||
1088 | 0.0, 0.0, render_surface_iterator, &data); | ||
1089 | } | ||
1090 | } | ||
1091 | goto renderer_end; | ||
1092 | } | ||
1093 | |||
1059 | if (output_has_opaque_overlay_layer_surface(output)) { | 1094 | if (output_has_opaque_overlay_layer_surface(output)) { |
1060 | goto render_overlay; | 1095 | goto render_overlay; |
1061 | } | 1096 | } |