Blame SOURCES/0001-wayland-xdg-shell-Queue-frame-callbacks-on-new-actor.patch

776610
From 998e3279c24278c947832917706cf5a31b80fa26 Mon Sep 17 00:00:00 2001
776610
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
776610
Date: Wed, 25 Jul 2018 11:49:36 +0200
776610
Subject: [PATCH 1/8] wayland/xdg-shell: Queue frame callbacks on new actor
776610
 after resetting
776610
776610
When a xdg-toplevel is reset, the window and actor are recreated, and
776610
all state is cleared. When this happened, we earlied out from the
776610
xdg-toplevel commit handler, which would mean that if the client had
776610
queued frame callbacks when resetting, they'd be left in the pending
776610
commit state, later hitting an assert as they were not handled.
776610
776610
Fix this by queuing the frame callbacks no the new actor, so that they
776610
are emitted whenever the actor is eventually painted.
776610
776610
https://gitlab.gnome.org/GNOME/mutter/issues/240
776610
(cherry picked from commit d791710197205028be40750d6ee4119f2b7f0e26)
776610
---
776610
 src/wayland/meta-wayland-actor-surface.c | 12 ++++++++----
776610
 src/wayland/meta-wayland-actor-surface.h |  3 +++
776610
 src/wayland/meta-wayland-xdg-shell.c     |  5 +++++
776610
 3 files changed, 16 insertions(+), 4 deletions(-)
776610
776610
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
776610
index c10694a2a..b6dbd3326 100644
776610
--- a/src/wayland/meta-wayland-actor-surface.c
776610
+++ b/src/wayland/meta-wayland-actor-surface.c
776610
@@ -47,10 +47,14 @@ meta_wayland_actor_surface_assigned (MetaWaylandSurfaceRole *surface_role)
776610
   wl_list_init (&surface->pending_frame_callback_list);
776610
 }
776610
 
776610
-static void
776610
-queue_surface_actor_frame_callbacks (MetaWaylandSurface      *surface,
776610
-                                     MetaWaylandPendingState *pending)
776610
+void
776610
+meta_wayland_actor_surface_queue_frame_callbacks (MetaWaylandActorSurface *actor_surface,
776610
+                                                  MetaWaylandPendingState *pending)
776610
 {
776610
+  MetaWaylandSurfaceRole *surface_role =
776610
+    META_WAYLAND_SURFACE_ROLE (actor_surface);
776610
+  MetaWaylandSurface *surface =
776610
+    meta_wayland_surface_role_get_surface (surface_role);
776610
   MetaSurfaceActorWayland *surface_actor =
776610
     META_SURFACE_ACTOR_WAYLAND (surface->surface_actor);
776610
 
776610
@@ -167,7 +171,7 @@ meta_wayland_actor_surface_commit (MetaWaylandSurfaceRole  *surface_role,
776610
     meta_wayland_surface_role_get_surface (surface_role);
776610
   MetaWaylandSurface *toplevel_surface;
776610
 
776610
-  queue_surface_actor_frame_callbacks (surface, pending);
776610
+  meta_wayland_actor_surface_queue_frame_callbacks (actor_surface, pending);
776610
 
776610
   toplevel_surface = meta_wayland_surface_get_toplevel (surface);
776610
   if (!toplevel_surface || !toplevel_surface->window)
776610
diff --git a/src/wayland/meta-wayland-actor-surface.h b/src/wayland/meta-wayland-actor-surface.h
776610
index a5cc24455..ab9b229ed 100644
776610
--- a/src/wayland/meta-wayland-actor-surface.h
776610
+++ b/src/wayland/meta-wayland-actor-surface.h
776610
@@ -40,4 +40,7 @@ void meta_wayland_actor_surface_sync_actor_state (MetaWaylandActorSurface *actor
776610
 
776610
 double meta_wayland_actor_surface_calculate_scale (MetaWaylandActorSurface *actor_surface);
776610
 
776610
+void meta_wayland_actor_surface_queue_frame_callbacks (MetaWaylandActorSurface *actor_surface,
776610
+                                                       MetaWaylandPendingState *pending);
776610
+
776610
 #endif /* META_WAYLAND_ACTOR_SURFACE_H */
776610
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
776610
index 2b1a71b19..4ab638f74 100644
776610
--- a/src/wayland/meta-wayland-xdg-shell.c
776610
+++ b/src/wayland/meta-wayland-xdg-shell.c
776610
@@ -626,7 +626,12 @@ meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
776610
 
776610
   if (!surface->buffer_ref.buffer && xdg_surface_priv->first_buffer_attached)
776610
     {
776610
+      MetaWaylandActorSurface *actor_surface =
776610
+        META_WAYLAND_ACTOR_SURFACE (xdg_toplevel);
776610
+
776610
       meta_wayland_xdg_surface_reset (xdg_surface);
776610
+      meta_wayland_actor_surface_queue_frame_callbacks (actor_surface,
776610
+                                                        pending);
776610
       return;
776610
     }
776610
 
776610
-- 
776610
2.19.0
776610