output: test adaptive sync

Required by https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3637
See also swaywm/sway@07bfeb2

Fixes #516
This commit is contained in:
Johan Malm 2022-11-12 15:51:46 +00:00 committed by Johan Malm
parent 2b753a98b8
commit 2a9a378176

View file

@ -176,9 +176,17 @@ new_output_notify(struct wl_listener *listener, void *data)
wlr_scene_node_raise_to_top(&output->layer_popup_tree->node);
if (rc.adaptive_sync) {
wlr_log(WLR_INFO, "enable adaptive sync on %s",
wlr_output->name);
wlr_output_enable_adaptive_sync(wlr_output, true);
wlr_log(WLR_INFO, "enable adaptive sync on %s", wlr_output->name);
struct wlr_output_state pending = { 0 };
wlr_output_state_set_adaptive_sync_enabled(&pending, true);
if (!wlr_output_test_state(wlr_output, &pending)) {
wlr_log(WLR_ERROR, "adaptive sync failed, ignoring");
wlr_output_state_set_adaptive_sync_enabled(&pending, false);
}
if (!wlr_output_commit_state(wlr_output, &pending)) {
wlr_log(WLR_ERROR, "failed to commit output %s",
wlr_output->name);
}
}
/*