|
|
776610 |
From 4dfe4256ae66a151fb5a570f34af0f85f3e5e0f5 Mon Sep 17 00:00:00 2001
|
|
|
776610 |
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
|
|
776610 |
Date: Mon, 27 Aug 2018 12:05:58 +0200
|
|
|
776610 |
Subject: [PATCH 2/8] wayland/surface: Add API to cache frame callbacks
|
|
|
776610 |
|
|
|
776610 |
Sometimes it may be useful for roles to put callbacks in the generic
|
|
|
776610 |
surface frame callback queue. The surface frame callback queue will
|
|
|
776610 |
either eventually be processed on the next surface role assignment that
|
|
|
776610 |
places the frame callbacks in a role specific queue, processed at some
|
|
|
776610 |
other point in time by a role, or cleaned up on surface destruction.
|
|
|
776610 |
|
|
|
776610 |
https://gitlab.gnome.org/GNOME/mutter/issues/240
|
|
|
776610 |
(cherry picked from commit 0ace58d05f3e50f4fdcf4971baab163e6ae5a1e9)
|
|
|
776610 |
---
|
|
|
776610 |
src/wayland/meta-wayland-surface.c | 17 ++++++++++-------
|
|
|
776610 |
src/wayland/meta-wayland-surface.h | 3 +++
|
|
|
776610 |
2 files changed, 13 insertions(+), 7 deletions(-)
|
|
|
776610 |
|
|
|
776610 |
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
|
|
|
776610 |
index d2f5ffccf..3c9a404c7 100644
|
|
|
776610 |
--- a/src/wayland/meta-wayland-surface.c
|
|
|
776610 |
+++ b/src/wayland/meta-wayland-surface.c
|
|
|
776610 |
@@ -602,6 +602,15 @@ parent_surface_state_applied (gpointer data,
|
|
|
776610 |
meta_wayland_subsurface_parent_state_applied (subsurface);
|
|
|
776610 |
}
|
|
|
776610 |
|
|
|
776610 |
+void
|
|
|
776610 |
+meta_wayland_surface_cache_pending_frame_callbacks (MetaWaylandSurface *surface,
|
|
|
776610 |
+ MetaWaylandPendingState *pending)
|
|
|
776610 |
+{
|
|
|
776610 |
+ wl_list_insert_list (&surface->pending_frame_callback_list,
|
|
|
776610 |
+ &pending->frame_callback_list);
|
|
|
776610 |
+ wl_list_init (&pending->frame_callback_list);
|
|
|
776610 |
+}
|
|
|
776610 |
+
|
|
|
776610 |
void
|
|
|
776610 |
meta_wayland_surface_apply_pending_state (MetaWaylandSurface *surface,
|
|
|
776610 |
MetaWaylandPendingState *pending)
|
|
|
776610 |
@@ -722,13 +731,7 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface *surface,
|
|
|
776610 |
}
|
|
|
776610 |
else
|
|
|
776610 |
{
|
|
|
776610 |
- /* Since there is no role assigned to the surface yet, keep frame
|
|
|
776610 |
- * callbacks queued until a role is assigned and we know how
|
|
|
776610 |
- * the surface will be drawn.
|
|
|
776610 |
- */
|
|
|
776610 |
- wl_list_insert_list (&surface->pending_frame_callback_list,
|
|
|
776610 |
- &pending->frame_callback_list);
|
|
|
776610 |
- wl_list_init (&pending->frame_callback_list);
|
|
|
776610 |
+ meta_wayland_surface_cache_pending_frame_callbacks (surface, pending);
|
|
|
776610 |
|
|
|
776610 |
if (pending->newly_attached)
|
|
|
776610 |
{
|
|
|
776610 |
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
|
|
|
776610 |
index 05d2a0a24..46accd900 100644
|
|
|
776610 |
--- a/src/wayland/meta-wayland-surface.h
|
|
|
776610 |
+++ b/src/wayland/meta-wayland-surface.h
|
|
|
776610 |
@@ -261,6 +261,9 @@ MetaWaylandSurface *meta_wayland_surface_get_toplevel (MetaWaylandSurface *surfa
|
|
|
776610 |
|
|
|
776610 |
MetaWindow * meta_wayland_surface_get_toplevel_window (MetaWaylandSurface *surface);
|
|
|
776610 |
|
|
|
776610 |
+void meta_wayland_surface_cache_pending_frame_callbacks (MetaWaylandSurface *surface,
|
|
|
776610 |
+ MetaWaylandPendingState *pending);
|
|
|
776610 |
+
|
|
|
776610 |
void meta_wayland_surface_queue_pending_frame_callbacks (MetaWaylandSurface *surface);
|
|
|
776610 |
|
|
|
776610 |
void meta_wayland_surface_queue_pending_state_frame_callbacks (MetaWaylandSurface *surface,
|
|
|
776610 |
--
|
|
|
776610 |
2.19.0
|
|
|
776610 |
|