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

Bug#985408: unblock: mutter/3.38.4-1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: debian-gtk-gnome@lists.debian.org

I would like to update mutter from our current heavily-patched 3.38.3
(effectively 3.38.4~git20210309) to the upstream 3.38.4 release.

[ Reason ]
* Fix a Wayland spec compliance issue that caused incorrect compositing
  (content displayed outside the intended window) during development of
  future Firefox optimizations
* Ship a real upstream release instead of what's effectively a git snapshot

[ Impact ]
If future Firefox versions make use of Wayland subsurfaces for WebRender,
Debian users will not be able to rely on web content being clipped to the
intended window unless we fix the mutter bug. This seems like something we
might need in a firefox-esr update during the bullseye cycle.

Shipping 3.38.4 instead of 3.38.4~git20210309 is more supportable by
upstream.

[ Tests ]
Manual testing: I use GNOME daily. I've installed this on multiple
systems including Intel/Mesa, AMD/Mesa and NVIDIA/proprietary.

[ Risks ]
It's a key package and regressions here would be highly visible (but
upstream are generally good about limiting the changes they'll make to
their stable-branches, and fixing any regressions promptly).

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing
      (because we dropped lots of patches, this is a diff between the
      patched trees, excluding d/patches/*.patch; I upload with dgit,
      so what's in git is guaranteed to match what's uploaded)

unblock mutter/3.38.4-1
git diff archive/debian/3.38.3-5..patch-queue/debian/master \
| filterdiff -p1 --exclude='debian/patches/*.patch'

diff --git a/NEWS b/NEWS
index 13038b284..79d5dd6f1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,21 @@
+3.38.4
+======
+* Do not ping unmanaging windows [Florian; gnome-shell#2467]
+* Handle monitor changes during screencasts [Jonas Å.; !1691]
+* Improve freezes when switching workspace [Jonas Å.; !1616]
+* Fix newly opened X11 windows being invisible in overview [Olivier; !1678]
+* Fix drag cancel animation when using geometry scaling [Robert; !1683]
+* Fix stuck icon in DND operation between X11 and wayland [Carlos; !1720]
+* Fix restoring focus to windows using globally active input [Olivier; !1716]
+* Disable double-buffered shadow buffering [Jonas Å.; !1743]
+* Fix frame timings causing X11 clients to get stuck  [Jonas Å.; !1754]
+* Fix order in which subsurface placement operations are handled [Robert; !1768]
+* Fixed crashes [Thomas, Jonas Å., Sebastian; !1694, !1719, !1748]
+
+Contributors:
+  Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Sebastian Keller, Robert Mader,
+  Thomas Mühlbacher, Florian Müllner
+
 3.38.3
 ======
 * xwayland: Set xrandr primary output [Aleksandr; !1638]
diff --git a/debian/changelog b/debian/changelog
index 19af0d134..aad563754 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+mutter (3.38.4-1) unstable; urgency=medium
+
+  * Team upload
+  * New upstream release
+    - Fix Wayland spec compliance when reordering subsurfaces.
+      This is likely to be required by future Firefox versions in native
+      Wayland mode.
+    - Many other fixes that we already had via debian/patches
+  * Drop most patches, included in the new upstream release
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 17 Mar 2021 09:52:33 +0000
+
 mutter (3.38.3-5) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/patches/series b/debian/patches/series
index e6cba7d38..18311933a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,29 +1,3 @@
-window-Do-not-handle-ungrabbed-events-when-unmanaging.patch
-window-Guard-can_ping-against-unmanaging-windows.patch
-monitor-config-store-Properly-escape-monitor-spec.patch
-monitor-config-Free-meta_monitor_spec-safely.patch
-tests-monitor-config-Improve-debugging-output.patch
-workspace-Downgrade-assert-to-warning-when-adding-window.patch
-screen-cast-stream-Add-getter-for-stream-src.patch
-screen-cast-monitor-stream-Don-t-fall-apart-when-monitor-.patch
-screen-cast-area-src-Handle-monitors-changes-here-too.patch
-window-Freeze-stack-when-calculating-showing-state.patch
-window-actor-Add-a-new-can_freeze_commits-API.patch
-window-x11-Check-before-freezing-commits.patch
-feedback-actor-Add-API-to-set-and-get-geometry-scale.patch
-wayland-dnd-surface-Use-new-API-to-set-geometry-scale-of-.patch
-compositor-dnd-actor-Take-geometry-scale-into-account-on-.patch
-clutter-timeline-Clear-stage-view-listener-when-actor-des.patch
-wayland-Make-XDnD-grab-unlink-source-offer-manually.patch
-wayland-Plug-XDnD-drag-source-leak.patch
-wayland-Manually-detach-source-offer-on-failure-paths.patch
-wayland-Avoid-automatically-decoupling-source-offer-after.patch
-window-Add-is_focus_async-API.patch
-core-Account-for-the-globally-active-input-case.patch
-clutter-stage-view-Disable-double-buffered-shadow-bufferi.patch
-compositor-x11-Notify-the-sync-ring-about-frames-on-updat.patch
-window-actor-x11-Queue-full-actor-redraw-when-redraw-queu.patch
-frame-Fix-crash-when-clicking-below-titlebar-with-broken-.patch
 theme-use-gtk_render_icon_suface-to-paint-button-icon.patch
 theme-load-icons-as-Gtk-does-with-fallback-and-RTL-suppor.patch
 meson-add-back-default_driver-option.patch
diff --git a/meson.build b/meson.build
index 616d476c4..4d8bdafcd 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('mutter', 'c',
-  version: '3.38.3',
+  version: '3.38.4',
   meson_version: '>= 0.51.0',
   license: 'GPLv2+'
 )
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index 5df3e5815..2fffd3a77 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -30,19 +30,6 @@
 #include "wayland/meta-wayland-surface.h"
 #include "wayland/meta-window-wayland.h"
 
-typedef enum
-{
-  META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE,
-  META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW
-} MetaWaylandSubsurfacePlacement;
-
-typedef struct
-{
-  MetaWaylandSubsurfacePlacement placement;
-  MetaWaylandSurface *sibling;
-  struct wl_listener sibling_destroy_listener;
-} MetaWaylandSubsurfacePlacementOp;
-
 struct _MetaWaylandSubsurface
 {
   MetaWaylandActorSurface parent;
@@ -135,57 +122,6 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
       surface->sub.pending_pos = FALSE;
     }
 
-  if (surface->sub.pending_placement_ops)
-    {
-      GSList *it;
-      MetaWaylandSurface *parent;
-
-      parent = surface->sub.parent;
-
-      for (it = surface->sub.pending_placement_ops; it; it = it->next)
-        {
-          MetaWaylandSubsurfacePlacementOp *op = it->data;
-          MetaWaylandSurface *sibling;
-          GNode *sibling_node;
-
-          if (!op->sibling)
-            {
-              g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
-              continue;
-            }
-
-          sibling = op->sibling;
-          if (is_child (surface, sibling))
-            sibling_node = sibling->subsurface_leaf_node;
-          else
-            sibling_node = sibling->subsurface_branch_node;
-
-          g_node_unlink (surface->subsurface_branch_node);
-
-          switch (op->placement)
-            {
-            case META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE:
-              g_node_insert_after (parent->subsurface_branch_node,
-                                   sibling_node,
-                                   surface->subsurface_branch_node);
-              break;
-            case META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW:
-              g_node_insert_before (parent->subsurface_branch_node,
-                                    sibling_node,
-                                    surface->subsurface_branch_node);
-              break;
-            }
-
-          wl_list_remove (&op->sibling_destroy_listener.link);
-          g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
-        }
-
-      g_slist_free (surface->sub.pending_placement_ops);
-      surface->sub.pending_placement_ops = NULL;
-
-      meta_wayland_surface_notify_subsurface_state_changed (parent);
-    }
-
   if (is_surface_effectively_synchronized (surface))
     meta_wayland_surface_apply_cached_state (surface);
 
@@ -406,6 +342,16 @@ is_valid_sibling (MetaWaylandSurface *surface,
   return FALSE;
 }
 
+static void
+subsurface_handle_pending_surface_destroyed (struct wl_listener *listener,
+                                             void               *data)
+{
+  MetaWaylandSubsurfacePlacementOp *op =
+    wl_container_of (listener, op, surface_destroy_listener);
+
+  op->surface = NULL;
+}
+
 static void
 subsurface_handle_pending_sibling_destroyed (struct wl_listener *listener,
                                              void               *data)
@@ -416,23 +362,39 @@ subsurface_handle_pending_sibling_destroyed (struct wl_listener *listener,
   op->sibling = NULL;
 }
 
+void
+meta_wayland_subsurface_placement_op_free (MetaWaylandSubsurfacePlacementOp *op)
+{
+  if (op->surface)
+    wl_list_remove (&op->surface_destroy_listener.link);
+  if (op->sibling)
+    wl_list_remove (&op->sibling_destroy_listener.link);
+  g_free (op);
+}
+
 static void
 queue_subsurface_placement (MetaWaylandSurface             *surface,
                             MetaWaylandSurface             *sibling,
                             MetaWaylandSubsurfacePlacement  placement)
 {
+  MetaWaylandSurface *parent = surface->sub.parent;
   MetaWaylandSubsurfacePlacementOp *op =
-    g_slice_new (MetaWaylandSubsurfacePlacementOp);
+    g_new0 (MetaWaylandSubsurfacePlacementOp, 1);
 
   op->placement = placement;
+  op->surface = surface;
   op->sibling = sibling;
+  op->surface_destroy_listener.notify =
+    subsurface_handle_pending_surface_destroyed;
   op->sibling_destroy_listener.notify =
     subsurface_handle_pending_sibling_destroyed;
+  wl_resource_add_destroy_listener (surface->resource,
+                                    &op->surface_destroy_listener);
   wl_resource_add_destroy_listener (sibling->resource,
                                     &op->sibling_destroy_listener);
 
-  surface->sub.pending_placement_ops =
-    g_slist_append (surface->sub.pending_placement_ops, op);
+  parent->pending_state->subsurface_placement_ops =
+    g_slist_append (parent->pending_state->subsurface_placement_ops, op);
 }
 
 static void
diff --git a/src/wayland/meta-wayland-subsurface.h b/src/wayland/meta-wayland-subsurface.h
index d92c02197..7ea6bc5ae 100644
--- a/src/wayland/meta-wayland-subsurface.h
+++ b/src/wayland/meta-wayland-subsurface.h
@@ -29,6 +29,21 @@ G_DECLARE_FINAL_TYPE (MetaWaylandSubsurface,
                       META, WAYLAND_SUBSURFACE,
                       MetaWaylandActorSurface)
 
+typedef enum
+{
+  META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE,
+  META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW
+} MetaWaylandSubsurfacePlacement;
+
+typedef struct
+{
+  MetaWaylandSubsurfacePlacement placement;
+  MetaWaylandSurface *surface;
+  MetaWaylandSurface *sibling;
+  struct wl_listener surface_destroy_listener;
+  struct wl_listener sibling_destroy_listener;
+} MetaWaylandSubsurfacePlacementOp;
+
 void meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface);
 
 void meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
@@ -36,6 +51,8 @@ void meta_wayland_subsurface_union_geometry (MetaWaylandSubsurface *subsurface,
                                              int                    parent_y,
                                              MetaRectangle         *out_geometry);
 
+void meta_wayland_subsurface_placement_op_free (MetaWaylandSubsurfacePlacementOp *op);
+
 void meta_wayland_subsurfaces_init (MetaWaylandCompositor *compositor);
 
 #endif /* META_WAYLAND_SUBSURFACE_H */
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index d1894a8cc..6f9af8584 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -466,6 +466,8 @@ meta_wayland_surface_state_set_default (MetaWaylandSurfaceState *state)
   state->has_new_buffer_transform = FALSE;
   state->has_new_viewport_src_rect = FALSE;
   state->has_new_viewport_dst_size = FALSE;
+
+  state->subsurface_placement_ops = NULL;
 }
 
 static void
@@ -483,6 +485,13 @@ meta_wayland_surface_state_clear (MetaWaylandSurfaceState *state)
 
   wl_list_for_each_safe (cb, next, &state->frame_callback_list, link)
     wl_resource_destroy (cb->resource);
+
+  if (state->subsurface_placement_ops)
+    {
+      g_slist_free_full (
+        state->subsurface_placement_ops,
+        (GDestroyNotify) meta_wayland_subsurface_placement_op_free);
+    }
 }
 
 static void
@@ -592,6 +601,22 @@ meta_wayland_surface_state_merge_into (MetaWaylandSurfaceState *from,
                           to);
     }
 
+  if (from->subsurface_placement_ops != NULL)
+    {
+      if (to->subsurface_placement_ops != NULL)
+        {
+          to->subsurface_placement_ops =
+            g_slist_concat (to->subsurface_placement_ops,
+                            from->subsurface_placement_ops);
+        }
+      else
+        {
+          to->subsurface_placement_ops = from->subsurface_placement_ops;
+        }
+
+      from->subsurface_placement_ops = NULL;
+    }
+
   meta_wayland_surface_state_reset (from);
 }
 
@@ -779,6 +804,43 @@ meta_wayland_surface_apply_state (MetaWaylandSurface      *surface,
         }
     }
 
+  if (state->subsurface_placement_ops)
+    {
+      GSList *l;
+
+      for (l = state->subsurface_placement_ops; l; l = l->next)
+        {
+          MetaWaylandSubsurfacePlacementOp *op = l->data;
+          GNode *sibling_node;
+
+          if (!op->surface || !op->sibling)
+            continue;
+
+          if (op->sibling == surface)
+            sibling_node = surface->subsurface_leaf_node;
+          else
+            sibling_node = op->sibling->subsurface_branch_node;
+
+          g_node_unlink (op->surface->subsurface_branch_node);
+
+          switch (op->placement)
+            {
+            case META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE:
+              g_node_insert_after (surface->subsurface_branch_node,
+                                   sibling_node,
+                                   op->surface->subsurface_branch_node);
+              break;
+            case META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW:
+              g_node_insert_before (surface->subsurface_branch_node,
+                                    sibling_node,
+                                    op->surface->subsurface_branch_node);
+              break;
+            }
+        }
+
+      meta_wayland_surface_notify_subsurface_state_changed (surface);
+    }
+
 cleanup:
   /* If we have a buffer that we are not using, decrease the use count so it may
    * be released if no-one else has a use-reference to it.
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index 0c7298886..f85a404b1 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -120,6 +120,8 @@ struct _MetaWaylandSurfaceState
   gboolean has_new_viewport_dst_size;
   int viewport_dst_width;
   int viewport_dst_height;
+
+  GSList *subsurface_placement_ops;
 };
 
 struct _MetaWaylandDragDestFuncs
@@ -209,7 +211,6 @@ struct _MetaWaylandSurface
     int32_t pending_x;
     int32_t pending_y;
     gboolean pending_pos;
-    GSList *pending_placement_ops;
   } sub;
 
   /* wp_viewport */

Reply to: