view: ensure output is usable before setting adaptive sync

Fixes #2337

Backported from
36e099fc93

Slightly modified to remove the additional `assert()`
to keep the code churn to a minimum.
This commit is contained in:
Consolatis 2024-11-13 14:24:07 +01:00 committed by Johan Malm
parent 6c05316f55
commit 0e557150f2

View file

@ -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);