[mutter] wayland/legacy-xdg-shell: Cache frame callbacks if toplevel is unmanaged

commit a740f50cd7d05582a251c23a7025999e55e4aba1
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Aug 27 12:36:51 2018 +0200

    wayland/legacy-xdg-shell: Cache frame callbacks if toplevel is unmanaged
    A toplevel window can be unmanaged without the client knowing it (e.g. a
    modal dialog being unmapped together with its parent. When this has
    happened, take frame callbacks queued on a commit and cache them on the
    generic surface queue. If the toplevel is to be remapped because the
    surface was reassigned the toplevel role, the cached frame callbacks
    will be queued on the surface actor and dispatched accordingly.

 src/wayland/meta-wayland-legacy-xdg-shell.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c
index fdae10e25..7e06dc166 100644
--- a/src/wayland/meta-wayland-legacy-xdg-shell.c
+++ b/src/wayland/meta-wayland-legacy-xdg-shell.c
@@ -598,11 +598,18 @@ meta_wayland_zxdg_toplevel_v6_commit (MetaWaylandSurfaceRole  *surface_role,
   MetaWaylandSurfaceRoleClass *surface_role_class;
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (surface_role);
-  MetaWindow *window = surface->window;
+  MetaWindow *window;
   MetaRectangle window_geometry;
   MetaRectangle old_geometry;
   gboolean geometry_changed;
+  window = surface->window;
+  if (!window)
+    {
+      meta_wayland_surface_cache_pending_frame_callbacks (surface, pending);
+      return;
+    }
   old_geometry = xdg_surface_priv->geometry;
   surface_role_class =

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]