wayland: Store list of presentation-time surfaces
These are surfaces that might have registered presentation-time callbacks, similar to the frame callback surface list. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
This commit is contained in:
parent
bb57f35296
commit
0c3490223e
4 changed files with 33 additions and 0 deletions
|
@ -36,6 +36,11 @@ typedef struct _MetaWaylandPresentationFeedback
|
||||||
MetaWaylandSurface *surface;
|
MetaWaylandSurface *surface;
|
||||||
} MetaWaylandPresentationFeedback;
|
} MetaWaylandPresentationFeedback;
|
||||||
|
|
||||||
|
typedef struct _MetaWaylandPresentationTime
|
||||||
|
{
|
||||||
|
GList *feedback_surfaces;
|
||||||
|
} MetaWaylandPresentationTime;
|
||||||
|
|
||||||
void meta_wayland_init_presentation_time (MetaWaylandCompositor *compositor);
|
void meta_wayland_init_presentation_time (MetaWaylandCompositor *compositor);
|
||||||
|
|
||||||
void meta_wayland_presentation_feedback_discard (MetaWaylandPresentationFeedback *feedback);
|
void meta_wayland_presentation_feedback_discard (MetaWaylandPresentationFeedback *feedback);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "core/window-private.h"
|
#include "core/window-private.h"
|
||||||
#include "meta/meta-cursor-tracker.h"
|
#include "meta/meta-cursor-tracker.h"
|
||||||
#include "wayland/meta-wayland-pointer-gestures.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-seat.h"
|
||||||
#include "wayland/meta-wayland-surface.h"
|
#include "wayland/meta-wayland-surface.h"
|
||||||
#include "wayland/meta-wayland-tablet-manager.h"
|
#include "wayland/meta-wayland-tablet-manager.h"
|
||||||
|
@ -94,6 +95,8 @@ struct _MetaWaylandCompositor
|
||||||
MetaWaylandTabletManager *tablet_manager;
|
MetaWaylandTabletManager *tablet_manager;
|
||||||
|
|
||||||
GHashTable *scheduled_surface_associations;
|
GHashTable *scheduled_surface_associations;
|
||||||
|
|
||||||
|
MetaWaylandPresentationTime presentation_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define META_TYPE_WAYLAND_COMPOSITOR (meta_wayland_compositor_get_type ())
|
#define META_TYPE_WAYLAND_COMPOSITOR (meta_wayland_compositor_get_type ())
|
||||||
|
|
|
@ -291,6 +291,25 @@ meta_wayland_compositor_remove_frame_callback_surface (MetaWaylandCompositor *co
|
||||||
g_list_remove (compositor->frame_callback_surfaces, surface);
|
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
|
static void
|
||||||
set_gnome_env (const char *name,
|
set_gnome_env (const char *name,
|
||||||
const char *value)
|
const char *value)
|
||||||
|
|
|
@ -66,6 +66,12 @@ void meta_wayland_compositor_add_frame_callback_surface (Meta
|
||||||
void meta_wayland_compositor_remove_frame_callback_surface (MetaWaylandCompositor *compositor,
|
void meta_wayland_compositor_remove_frame_callback_surface (MetaWaylandCompositor *compositor,
|
||||||
MetaWaylandSurface *surface);
|
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
|
META_EXPORT_TEST
|
||||||
const char *meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor);
|
const char *meta_wayland_get_wayland_display_name (MetaWaylandCompositor *compositor);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue