From c6db2ccee0738a05095e8b1967e6e0155ba168f8 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Sat, 19 Oct 2024 20:06:11 -0400 Subject: [PATCH] output: move a few calls from new_output_notify() ... to more specific/logical locations, to make it possible in future to *not* immediately auto-configure new outputs when connected. In particular: - Move regions_reconfigure_output() and session_lock_output_create() into add_output_to_layout(), which would be called also if the output is enabled later. - Move seat_output_layout_changed() to do_output_layout_change() so it is called for any layout change, not just adding new outputs. --- src/output.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/output.c b/src/output.c index cd7299b1..d71d7ec9 100644 --- a/src/output.c +++ b/src/output.c @@ -305,6 +305,14 @@ add_output_to_layout(struct server *server, struct output *output) lab_cosmic_workspace_group_output_enter( server->workspaces.cosmic_group, output->wlr_output); + + /* (Re-)create regions from config */ + regions_reconfigure_output(output); + + /* Create lock surface if needed */ + if (server->session_lock_manager->locked) { + session_lock_output_create(server->session_lock_manager, output); + } } static void @@ -479,16 +487,8 @@ new_output_notify(struct wl_listener *listener, void *data) add_output_to_layout(server, output); - /* Create regions from config */ - regions_reconfigure_output(output); - - if (server->session_lock_manager->locked) { - session_lock_output_create(server->session_lock_manager, output); - } - server->pending_output_layout_change--; do_output_layout_change(server); - seat_output_layout_changed(&output->server->seat); } void @@ -793,6 +793,7 @@ do_output_layout_change(struct server *server) "wlr_output_manager_v1_set_configuration()"); } output_update_for_layout_change(server); + seat_output_layout_changed(&server->seat); } }