fix: adaptive_sync not apply in init

This commit is contained in:
DreamMaoMao 2025-09-18 20:55:42 +08:00
parent 481a76eb36
commit 67e9787e36

View file

@ -2619,10 +2619,6 @@ void createmon(struct wl_listener *listener, void *data) {
} }
} }
if (adaptive_sync) {
enable_adaptive_sync(m, &state);
}
/* The mode is a tuple of (width, height, refresh rate), and each /* The mode is a tuple of (width, height, refresh rate), and each
* monitor supports only a specific set of modes. We just pick the * monitor supports only a specific set of modes. We just pick the
* monitor's preferred mode; a more sophisticated compositor would let * monitor's preferred mode; a more sophisticated compositor would let
@ -2631,6 +2627,10 @@ void createmon(struct wl_listener *listener, void *data) {
wlr_output_state_set_mode(&state, wlr_output_state_set_mode(&state,
wlr_output_preferred_mode(wlr_output)); wlr_output_preferred_mode(wlr_output));
if (adaptive_sync) {
enable_adaptive_sync(m, &state);
}
/* Set up event listeners */ /* Set up event listeners */
LISTEN(&wlr_output->events.frame, &m->frame, rendermon); LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon); LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);