From 0e557150f2ce03dc17df8df76e33e969cc30d4b7 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:24:07 +0100 Subject: [PATCH] view: ensure output is usable before setting adaptive sync Fixes #2337 Backported from 36e099fc93b3caf87e7f390a732fcec69373de8c Slightly modified to remove the additional `assert()` to keep the code churn to a minimum. --- src/view.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/view.c b/src/view.c index 481ec195..ecefc24f 100644 --- a/src/view.c +++ b/src/view.c @@ -372,6 +372,11 @@ set_adaptive_sync_fullscreen(struct view *view) if (rc.adaptive_sync != LAB_ADAPTIVE_SYNC_FULLSCREEN) { return; } + + if (!output_is_usable(view->output)) { + return; + } + /* Enable adaptive sync if view is fullscreen */ output_enable_adaptive_sync(view->output->wlr_output, view->fullscreen); wlr_output_commit(view->output->wlr_output);