kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0004-wayland-xdg-shell-Cache-frame-callbacks-if-toplevel-.patch

776610
From b5c2555601da7c8b347664e7ef34803e08a52697 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:30:07 +0200
776610
Subject: [PATCH 4/8] wayland/xdg-shell: Cache frame callbacks if toplevel is
776610
 unmanaged
776610
776610
A toplevel window can be unmanaged without the client knowing it (e.g. a
776610
modal dialog being unmapped together with its parent. When this has
776610
happened, take frame callbacks queued on a commit and cache them on the
776610
generic surface queue. If the toplevel is to be remapped, either because
776610
the surface was reassigned the toplevel role, or if it was reset and
776610
remapped, the cached frame callbacks will be queued on the surface actor
776610
and dispatched accordingly.
776610
776610
https://gitlab.gnome.org/GNOME/mutter/issues/240
776610
(cherry picked from commit 80d420ff430e8e9495fd29d68084cb050600b26f)
776610
---
776610
 src/wayland/meta-wayland-xdg-shell.c | 8 +++++++-
776610
 1 file changed, 7 insertions(+), 1 deletion(-)
776610
776610
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
776610
index 3cf6b5716..9e300df6b 100644
776610
--- a/src/wayland/meta-wayland-xdg-shell.c
776610
+++ b/src/wayland/meta-wayland-xdg-shell.c
776610
@@ -624,6 +624,13 @@ meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
776610
   MetaRectangle old_geometry;
776610
   gboolean geometry_changed;
776610
 
776610
+  window = surface->window;
776610
+  if (!window)
776610
+    {
776610
+      meta_wayland_surface_cache_pending_frame_callbacks (surface, pending);
776610
+      return;
776610
+    }
776610
+
776610
   if (!surface->buffer_ref.buffer && xdg_surface_priv->first_buffer_attached)
776610
     {
776610
       MetaWaylandActorSurface *actor_surface =
776610
@@ -635,7 +642,6 @@ meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
776610
       return;
776610
     }
776610
 
776610
-  window = surface->window;
776610
   old_geometry = xdg_surface_priv->geometry;
776610
 
776610
   surface_role_class =
776610
-- 
776610
2.19.0
776610