Skip to content

Commit

Permalink
output: ensure output is marked as enabled before trying to set mode
Browse files Browse the repository at this point in the history
Otherwise, testing to set preferred / "best" mode will always return an
error. Consequently, output will simply be configured with last and
probably "worst" mode.
  • Loading branch information
joggee-fr committed Sep 1, 2023
1 parent 3730c59 commit 69fb507
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions output.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ handle_new_output(struct wl_listener *listener, void *data)
wl_signal_add(&wlr_output->events.frame, &output->frame);

if (!wl_list_empty(&wlr_output->modes)) {
/* Ensure the output is marked as enabled before trying to set mode */
wlr_output_enable(wlr_output, true);

struct wlr_output_mode *preferred_mode = wlr_output_preferred_mode(wlr_output);
if (preferred_mode) {
wlr_output_set_mode(wlr_output, preferred_mode);
Expand Down

0 comments on commit 69fb507

Please sign in to comment.