mirror of
https://github.com/swaywm/sway.git
synced 2024-11-28 02:41:28 +00:00
config/output: Check if preferred mode is NULL
This commit is contained in:
parent
020a572ed6
commit
4e28bce6d0
|
@ -278,6 +278,10 @@ static void set_mode(struct wlr_output *output, struct wlr_output_state *pending
|
||||||
best->width, best->height, best->refresh / 1000.f, output->name);
|
best->width, best->height, best->refresh / 1000.f, output->name);
|
||||||
} else {
|
} else {
|
||||||
best = wlr_output_preferred_mode(output);
|
best = wlr_output_preferred_mode(output);
|
||||||
|
if (!best) {
|
||||||
|
sway_log(SWAY_ERROR, "No preferred mode for output %s", output->name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
sway_log(SWAY_INFO, "Configured mode (%dx%d@%.3fHz) not available, "
|
sway_log(SWAY_INFO, "Configured mode (%dx%d@%.3fHz) not available, "
|
||||||
"applying preferred mode (%dx%d@%.3fHz)",
|
"applying preferred mode (%dx%d@%.3fHz)",
|
||||||
width, height, refresh_rate,
|
width, height, refresh_rate,
|
||||||
|
|
Loading…
Reference in a new issue