output: use wlr_frame_scheduler

Update for: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5330
This commit is contained in:
Simon Ser 2026-04-05 16:17:11 +00:00 committed by Kenny Levinsen
parent 909a2ddb5f
commit 4fa497f9d7
2 changed files with 3 additions and 8 deletions

View file

@ -4,6 +4,7 @@
#include <unistd.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_damage_ring.h>
#include <wlr/types/wlr_frame_scheduler.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_scene.h>
#include "config.h"

View file

@ -9,6 +9,7 @@
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/types/wlr_alpha_modifier_v1.h>
#include <wlr/types/wlr_frame_scheduler.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_output_management_v1.h>
@ -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;