mirror of
https://github.com/swaywm/sway.git
synced 2026-05-05 06:46:49 -04:00
scene_graph: Port ext_session_v1
This commit is contained in:
parent
0639bde9fb
commit
9a57966606
12 changed files with 280 additions and 192 deletions
|
|
@ -798,6 +798,10 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
output->repaint_timer = wl_event_loop_add_timer(server->wl_event_loop,
|
||||
output_repaint_timer_handler, output);
|
||||
|
||||
if (server->session_lock.lock) {
|
||||
sway_session_lock_add_output(server->session_lock.lock, output);
|
||||
}
|
||||
|
||||
struct output_config *oc = find_output_config(output);
|
||||
apply_output_config(oc, output);
|
||||
free_output_config(oc);
|
||||
|
|
|
|||
|
|
@ -1012,43 +1012,6 @@ void output_render(struct render_context *ctx) {
|
|||
pixman_region32_copy(&transformed_damage, damage);
|
||||
transform_output_damage(&transformed_damage, wlr_output);
|
||||
|
||||
if (server.session_lock.locked) {
|
||||
struct wlr_render_color clear_color = {
|
||||
.a = 1.0f
|
||||
};
|
||||
if (server.session_lock.lock == NULL) {
|
||||
// abandoned lock -> red BG
|
||||
clear_color.r = 1.f;
|
||||
}
|
||||
|
||||
wlr_render_pass_add_rect(ctx->pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
.color = clear_color,
|
||||
.clip = &transformed_damage,
|
||||
});
|
||||
|
||||
if (server.session_lock.lock != NULL) {
|
||||
struct render_data data = {
|
||||
.alpha = 1.0f,
|
||||
.ctx = ctx,
|
||||
};
|
||||
|
||||
struct wlr_session_lock_surface_v1 *lock_surface;
|
||||
wl_list_for_each(lock_surface, &server.session_lock.lock->surfaces, link) {
|
||||
if (lock_surface->output != wlr_output) {
|
||||
continue;
|
||||
}
|
||||
if (!lock_surface->surface->mapped) {
|
||||
continue;
|
||||
}
|
||||
|
||||
output_surface_for_each_surface(output, lock_surface->surface,
|
||||
0.0, 0.0, render_surface_iterator, &data);
|
||||
}
|
||||
}
|
||||
goto renderer_end;
|
||||
}
|
||||
|
||||
if (output_has_opaque_overlay_layer_surface(output)) {
|
||||
goto render_overlay;
|
||||
}
|
||||
|
|
@ -1122,8 +1085,6 @@ render_overlay:
|
|||
&output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]);
|
||||
render_layer_popups(ctx,
|
||||
&output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]);
|
||||
|
||||
renderer_end:
|
||||
pixman_region32_fini(&transformed_damage);
|
||||
wlr_output_add_software_cursors_to_render_pass(wlr_output, ctx->pass, damage);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue