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

@ -10,6 +10,7 @@
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_frame_scheduler.h>
#include <wlr/types/wlr_fullscreen_shell_v1.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_output_layout.h>
@ -39,6 +40,7 @@ struct fullscreen_output {
struct wl_list link;
struct fullscreen_server *server;
struct wlr_output *wlr_output;
struct wlr_frame_scheduler *frame_scheduler;
struct wlr_surface *surface;
struct wl_listener surface_destroy;
@ -158,10 +160,12 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
calloc(1, sizeof(struct fullscreen_output));
output->wlr_output = wlr_output;
output->server = server;
output->frame.notify = output_handle_frame;
wl_signal_add(&wlr_output->events.frame, &output->frame);
wl_list_insert(&server->outputs, &output->link);
output->frame_scheduler = wlr_frame_scheduler_autocreate(wlr_output);
output->frame.notify = output_handle_frame;
wl_signal_add(&output->frame_scheduler->frame, &output->frame);
wlr_output_layout_add_auto(server->output_layout, wlr_output);
wlr_output_create_global(wlr_output);