summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/config/output.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 6c716ccb..a30d7954 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -222,7 +222,9 @@ static bool set_mode(struct wlr_output *output, int width, int height,
222 best = mode; 222 best = mode;
223 break; 223 break;
224 } 224 }
225 best = mode->refresh > best->refresh ? mode : best; 225 if (best == NULL || mode->refresh > best->refresh) {
226 best = mode;
227 }
226 } 228 }
227 } 229 }
228 if (!best) { 230 if (!best) {