mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
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
This commit is contained in:
parent
c9fa751042
commit
97a6524a5a
1 changed files with 10 additions and 13 deletions
|
@ -345,20 +345,17 @@ static void queue_output_config(struct output_config *oc,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!oc) {
|
sway_log(SWAY_DEBUG, "Turning on output %s", wlr_output->name);
|
||||||
sway_log(SWAY_DEBUG, "Turning on output %s", wlr_output->name);
|
wlr_output_enable(wlr_output, true);
|
||||||
wlr_output_enable(wlr_output, true);
|
|
||||||
|
|
||||||
if (oc && oc->width > 0 && oc->height > 0) {
|
if (oc && oc->width > 0 && oc->height > 0) {
|
||||||
sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f Hz)",
|
sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f Hz)",
|
||||||
wlr_output->name, oc->width, oc->height, oc->refresh_rate);
|
wlr_output->name, oc->width, oc->height, oc->refresh_rate);
|
||||||
set_mode(wlr_output, oc->width, oc->height,
|
set_mode(wlr_output, oc->width, oc->height,
|
||||||
oc->refresh_rate, oc->custom_mode == 1);
|
oc->refresh_rate, oc->custom_mode == 1);
|
||||||
} else if (!wl_list_empty(&wlr_output->modes)) {
|
} else if (!wl_list_empty(&wlr_output->modes)) {
|
||||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
||||||
wlr_output_set_mode(wlr_output, mode);
|
wlr_output_set_mode(wlr_output, mode);
|
||||||
}
|
|
||||||
output->current_mode = wlr_output->pending.mode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) {
|
if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) {
|
||||||
|
|
Loading…
Reference in a new issue