Skip to content

Commit

Permalink
desktop/output: fix output manager enabled state
Browse files Browse the repository at this point in the history
With recent wlroots changes, backends which don't support output
modes can now support being disabled.

We were always marking mode-less outputs as disabled. Stop doing
that, check whether the output takes up some space in the layout
instead.
  • Loading branch information
emersion committed Jul 31, 2023
1 parent d3626ef commit 170598d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sway/desktop/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,12 +883,9 @@ static void update_output_manager_config(struct sway_server *server) {
wlr_output_layout_get_box(root->output_layout,
output->wlr_output, &output_box);
// We mark the output enabled when it's switched off but not disabled
config_head->state.enabled = output->current_mode != NULL && output->enabled;
config_head->state.mode = output->current_mode;
if (!wlr_box_empty(&output_box)) {
config_head->state.x = output_box.x;
config_head->state.y = output_box.y;
}
config_head->state.enabled = !wlr_box_empty(&output_box);
config_head->state.x = output_box.x;
config_head->state.y = output_box.y;
}

wlr_output_manager_v1_set_configuration(server->output_manager_v1, config);
Expand Down

0 comments on commit 170598d

Please sign in to comment.