Drop sway_output.events.disable

In general wl_signal isn't well-suited for Sway: Sway doesn't need
any modularity, and signals make it trickier to track down exactly
what happens down the stack.

Replace Sway's output disable signal with a simple list tracking
for the only user.
This commit is contained in:
Simon Ser 2025-05-06 09:20:46 +02:00
parent 56f2db062d
commit a1ac2a2e93
4 changed files with 17 additions and 20 deletions

View file

@ -136,12 +136,11 @@ struct sway_output *output_create(struct wlr_output *wlr_output) {
output->detected_subpixel = wlr_output->subpixel;
output->scale_filter = SCALE_FILTER_NEAREST;
wl_signal_init(&output->events.disable);
wl_list_insert(&root->all_outputs, &output->link);
output->workspaces = create_list();
output->current.workspaces = create_list();
wl_list_init(&output->layer_surfaces);
return output;
}
@ -284,7 +283,6 @@ void output_disable(struct sway_output *output) {
}
sway_log(SWAY_DEBUG, "Disabling output '%s'", output->wlr_output->name);
wl_signal_emit_mutable(&output->events.disable, output);
// Remove the output now to avoid interacting with it during e.g.,
// transactions, as the output might be physically removed with the scene
@ -292,6 +290,7 @@ void output_disable(struct sway_output *output) {
list_del(root->outputs, index);
output->enabled = false;
destroy_layers(output);
output_evacuate(output);
}