From ea49db4090622824d81bc17cad589e0d6a4c3553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sun, 17 Dec 2023 15:26:52 -0600 Subject: [PATCH] use the new frame scheduler (wlroots!4307) References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4307 --- config.mk | 10 +++++----- dwl.c | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config.mk b/config.mk index 709d09b..4578d00 100644 --- a/config.mk +++ b/config.mk @@ -11,12 +11,12 @@ DATADIR = $(PREFIX)/share # Allow using an alternative wlroots installations # This has to have all the includes required by wlroots, e.g: # Assuming wlroots git repo is "${PWD}/wlroots" and you only ran "meson setup build && ninja -C build" -#WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \ -# -I$(PWD)/wlroots/include +WLR_INCS = -I/usr/include/pixman-1 -I/usr/include/elogind -I/usr/include/libdrm \ + -I$(PWD)/wlroots/include # Set -rpath to avoid using the system library. -#WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/build -L$(PWD)/wlroots/build -lwlroots-0.19 -WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.19` -WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.19` +WLR_LIBS = -Wl,-rpath,$(PWD)/wlroots/build-new-frame-scheduler -L$(PWD)/wlroots/build-new-frame-scheduler -lwlroots +#WLR_INCS = `$(PKG_CONFIG) --cflags wlroots-0.19` +#WLR_LIBS = `$(PKG_CONFIG) --libs wlroots-0.19` XWAYLAND = XLIBS = diff --git a/dwl.c b/dwl.c index 3785e4d..2f14a72 100644 --- a/dwl.c +++ b/dwl.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1012,8 +1013,10 @@ createmon(struct wl_listener *listener, void *data) * the user configure it. */ wlr_output_state_set_mode(&state, wlr_output_preferred_mode(wlr_output)); + m->scene_output = wlr_scene_output_create(scene, wlr_output); + /* Set up event listeners */ - LISTEN(&wlr_output->events.frame, &m->frame, rendermon); + LISTEN(&m->scene_output->frame_scheduler->events.frame, &m->frame, rendermon); LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon); LISTEN(&wlr_output->events.request_state, &m->request_state, requestmonstate); @@ -1042,7 +1045,6 @@ createmon(struct wl_listener *listener, void *data) * display, which Wayland clients can see to find out information about the * output (such as DPI, scale factor, manufacturer, etc). */ - m->scene_output = wlr_scene_output_create(scene, wlr_output); if (m->m.x == -1 && m->m.y == -1) wlr_output_layout_add_auto(output_layout, wlr_output); else @@ -2135,7 +2137,7 @@ rendermon(struct wl_listener *listener, void *data) goto commit; } wlr_output_commit_state(m->wlr_output, &pending); - wlr_output_schedule_frame(m->wlr_output); + wlr_frame_scheduler_schedule_frame(m->scene_output->frame_scheduler); } else { commit: wlr_scene_output_commit(m->scene_output, NULL); @@ -2349,7 +2351,7 @@ setgamma(struct wl_listener *listener, void *data) if (!m) return; m->gamma_lut_changed = 1; - wlr_output_schedule_frame(m->wlr_output); + wlr_frame_scheduler_schedule_frame(m->scene_output->frame_scheduler); } void