]> git.mdlowis.com Git - proto/labwc.git/commitdiff
output: move a few calls from new_output_notify()
authorJohn Lindgren <john@jlindgren.net>
Sun, 20 Oct 2024 00:06:11 +0000 (20:06 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 6 Nov 2024 20:46:50 +0000 (20:46 +0000)
... 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

index 0eee633128d68ce0f83dfe11238b444dd47e1b1a..4386a1b957ffa17273c33d502b5e47c1d1cb1689 100644 (file)
@@ -277,6 +277,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
@@ -451,16 +459,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
@@ -765,6 +765,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);
        }
 }