aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2020-04-09 10:01:21 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2020-04-09 15:45:29 +0200
commit97a6524a5acfe32d1ebb08bf18d86aa3fb942a14 (patch)
tree052a83815949d0b6972e96f34624071c418f60d4
parentci: remove epoll-shim hardcoded pkg-config file (diff)
downloadsway-97a6524a5acfe32d1ebb08bf18d86aa3fb942a14.tar.gz
sway-97a6524a5acfe32d1ebb08bf18d86aa3fb942a14.tar.zst
sway-97a6524a5acfe32d1ebb08bf18d86aa3fb942a14.zip
Fix initial modeset
An if branch takes care of the case where the output needs to be turned off (DPMS'ed or disabled). The other branch needs to unconditionally enable the output. output->current_mode is already taken care of in apply_config. Sorry about that, probably made a bad change by mistake after my DRM testing. Closes: https://github.com/swaywm/sway/issues/5193
-rw-r--r--sway/config/output.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 1a37c47c..8dfa8c57 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -345,20 +345,17 @@ static void queue_output_config(struct output_config *oc,
345 return; 345 return;
346 } 346 }
347 347
348 if (!oc) { 348 sway_log(SWAY_DEBUG, "Turning on output %s", wlr_output->name);
349 sway_log(SWAY_DEBUG, "Turning on output %s", wlr_output->name); 349 wlr_output_enable(wlr_output, true);
350 wlr_output_enable(wlr_output, true); 350
351 351 if (oc && oc->width > 0 && oc->height > 0) {
352 if (oc && oc->width > 0 && oc->height > 0) { 352 sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f Hz)",
353 sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f Hz)", 353 wlr_output->name, oc->width, oc->height, oc->refresh_rate);
354 wlr_output->name, oc->width, oc->height, oc->refresh_rate); 354 set_mode(wlr_output, oc->width, oc->height,
355 set_mode(wlr_output, oc->width, oc->height, 355 oc->refresh_rate, oc->custom_mode == 1);
356 oc->refresh_rate, oc->custom_mode == 1); 356 } else if (!wl_list_empty(&wlr_output->modes)) {
357 } else if (!wl_list_empty(&wlr_output->modes)) { 357 struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
358 struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output); 358 wlr_output_set_mode(wlr_output, mode);
359 wlr_output_set_mode(wlr_output, mode);
360 }
361 output->current_mode = wlr_output->pending.mode;
362 } 359 }
363 360
364 if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) { 361 if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) {