summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-09-06 00:29:44 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-09-06 00:35:20 -0500
commitdc59f7733d0315b3240b46321f3b5ae2ecc16b49 (patch)
treea589b1394d12d52311393fc71da79ccf849f3189
parent83e37820d778f935af0123d3b4bc0512265fbfac (diff)
enable adaptive sync if supported
but don't cause monitors to be ignored if it fails
-rw-r--r--dwl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index 52109ee..b80f3aa 100644
--- a/dwl.c
+++ b/dwl.c
@@ -803,7 +803,6 @@ createmon(struct wl_listener *listener, void *data)
* monitor's preferred mode; a more sophisticated compositor would let
* the user configure it. */
wlr_output_set_mode(wlr_output, wlr_output_preferred_mode(wlr_output));
- wlr_output_enable_adaptive_sync(wlr_output, 1);
/* Set up event listeners */
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
@@ -813,6 +812,11 @@ createmon(struct wl_listener *listener, void *data)
if (!wlr_output_commit(wlr_output))
return;
+ /* Try to enable adaptive sync, note that not all monitors support it.
+ * wlr_output_commit() will deactivate it in case it cannot be enabled */
+ wlr_output_enable_adaptive_sync(wlr_output, 1);
+ wlr_output_commit(wlr_output);
+
wl_list_insert(&mons, &m->link);
printstatus();