diff --git a/src/wayland/meta-wayland-presentation-time-private.h b/src/wayland/meta-wayland-presentation-time-private.h index f13e42c0f..234ac3495 100644 --- a/src/wayland/meta-wayland-presentation-time-private.h +++ b/src/wayland/meta-wayland-presentation-time-private.h @@ -36,6 +36,11 @@ typedef struct _MetaWaylandPresentationFeedback MetaWaylandSurface *surface; } MetaWaylandPresentationFeedback; +typedef struct _MetaWaylandPresentationTime +{ + GList *feedback_surfaces; +} MetaWaylandPresentationTime; + void meta_wayland_init_presentation_time (MetaWaylandCompositor *compositor); void meta_wayland_presentation_feedback_discard (MetaWaylandPresentationFeedback *feedback); diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h index 82a256f60..3306c192c 100644 --- a/src/wayland/meta-wayland-private.h +++ b/src/wayland/meta-wayland-private.h @@ -27,6 +27,7 @@ #include "core/window-private.h" #include "meta/meta-cursor-tracker.h" #include "wayland/meta-wayland-pointer-gestures.h" +#include "wayland/meta-wayland-presentation-time-private.h" #include "wayland/meta-wayland-seat.h" #include "wayland/meta-wayland-surface.h" #include "wayland/meta-wayland-tablet-manager.h" @@ -94,6 +95,8 @@ struct _MetaWaylandCompositor MetaWaylandTabletManager *tablet_manager; GHashTable *scheduled_surface_associations; + + MetaWaylandPresentationTime presentation_time; }; #define META_TYPE_WAYLAND_COMPOSITOR (meta_wayland_compositor_get_type ()) diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 45bc7ace0..731e24727 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -291,6 +291,25 @@ meta_wayland_compositor_remove_frame_callback_surface (MetaWaylandCompositor *co g_list_remove (compositor->frame_callback_surfaces, surface); } +void +meta_wayland_compositor_add_presentation_feedback_surface (MetaWaylandCompositor *compositor, + MetaWaylandSurface *surface) +{ + if (g_list_find (compositor->presentation_time.feedback_surfaces, surface)) + return; + + compositor->presentation_time.feedback_surfaces = + g_list_prepend (compositor->presentation_time.feedback_surfaces, surface); +} + +void +meta_wayland_compositor_remove_presentation_feedback_surface (MetaWaylandCompositor *compositor, + MetaWaylandSurface *surface) +{ + compositor->presentation_time.feedback_surfaces = + g_list_remove (compositor->presentation_time.feedback_surfaces, surface); +} + static void set_gnome_env (const char *name, const char *value) diff --git a/src/wayland/meta-wayland.h b/src/wayland/meta-wayland.h index 454330e4f..6c655e427 100644 --- a/src/wayland/meta-wayland.h +++ b/src/wayland/meta-wayland.h @@ -66,6 +66,12 @@ void meta_wayland_compositor_add_frame_callback_surface (Meta void meta_wayland_compositor_remove_frame_callback_surface (MetaWaylandCompositor *compositor, MetaWaylandSurface *surface); +void meta_wayland_compositor_add_presentation_feedback_surface (MetaWaylandCompositor *compositor, + MetaWaylandSurface *surface); + +void meta_wayland_compositor_remove_presentation_feedback_surface (MetaWaylandCompositor *compositor, + MetaWaylandSurface *surface); + META_EXPORT_TEST const char *meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor);