examples: switch to new frame scheduling

This commit is contained in:
Rose Hudson 2023-07-29 11:26:39 +01:00
parent ea11856851
commit ef710e3fd4
11 changed files with 57 additions and 15 deletions

View file

@ -12,6 +12,7 @@
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_frame_scheduler.h>
#include <wlr/types/wlr_keyboard.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_output_layout.h>
@ -64,6 +65,7 @@ struct touch_point {
struct sample_output {
struct sample_state *state;
struct wlr_output *output;
struct wlr_frame_scheduler *frame_scheduler;
struct wl_listener frame;
struct wl_listener destroy;
};
@ -269,7 +271,8 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
sample_output->output = output;
sample_output->state = sample;
wl_signal_add(&output->events.frame, &sample_output->frame);
sample_output->frame_scheduler = wlr_frame_scheduler_autocreate(output);
wl_signal_add(&sample_output->frame_scheduler->frame, &sample_output->frame);
sample_output->frame.notify = output_frame_notify;
wl_signal_add(&output->events.destroy, &sample_output->destroy);
sample_output->destroy.notify = output_remove_notify;