From 4fa497f9d70f8ff3c1a06090e135205eb568b692 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 5 Apr 2026 16:17:11 +0000 Subject: [PATCH] output: use wlr_frame_scheduler Update for: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5330 --- include/sway/output.h | 1 + sway/desktop/output.c | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/sway/output.h b/include/sway/output.h index ae2e50d36..bd48155b5 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include "config.h" diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 12dc9cc7a..0327498fb 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -270,7 +271,6 @@ static bool output_can_tear(struct sway_output *output) { static int output_repaint_timer_handler(void *data) { struct sway_output *output = data; - output->wlr_output->frame_pending = false; if (!output->wlr_output->enabled) { return 0; } @@ -281,11 +281,6 @@ static int output_repaint_timer_handler(void *data) { .color_transform = output->color_transform, }; - struct wlr_scene_output *scene_output = output->scene_output; - if (!wlr_scene_output_needs_frame(scene_output)) { - return 0; - } - struct wlr_output_state pending; wlr_output_state_init(&pending); if (!wlr_scene_output_build_state(output->scene_output, &pending, &opts)) { @@ -362,7 +357,6 @@ static void handle_frame(struct wl_listener *listener, void *user_data) { if (delay < 1) { output_repaint_timer_handler(output); } else { - output->wlr_output->frame_pending = true; wl_event_source_timer_update(output->repaint_timer, delay); } @@ -585,7 +579,7 @@ void handle_new_output(struct wl_listener *listener, void *data) { output->destroy.notify = handle_destroy; wl_signal_add(&wlr_output->events.present, &output->present); output->present.notify = handle_present; - wl_signal_add(&wlr_output->events.frame, &output->frame); + wl_signal_add(&scene_output->frame_scheduler->events.frame, &output->frame); output->frame.notify = handle_frame; wl_signal_add(&wlr_output->events.request_state, &output->request_state); output->request_state.notify = handle_request_state;