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

Bug#985285: marked as done (unblock: mutter/3.38.3-5)



Your message dated Tue, 16 Mar 2021 16:43:50 +0000
with message-id <E1lMCnO-0005dU-83@respighi.debian.org>
and subject line unblock mutter
has caused the Debian Bug report #985285,
regarding unblock: mutter/3.38.3-5
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
985285: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=985285
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package mutter

[ Reason ]
* Update from upstream gnome-3-38 branch to pick up bug fixes backported
  from GNOME 40 development. I was hoping for a 3.38.4 release sometime
  around our freeze date, but that hasn't happened.
* Test this package in its (superficial) autopkgtest, rather than testing
  leftover GNOME 3.36 packages with a previous SONAME

[ Impact ]
These upstream bugs affect bullseye and are fixed here:

* A crash when clicking below the window title bar in certain GTK themes
* X11 applications weren't reliably redrawn when they should be
* Incorrect focus handling under X11, when minimizing a window that should
  have resulted in focus passing to an AWT/Swing Java application
* A significant performance regression on machines that don't support
  hardware acceleration, such as some NVIDIA GPUs with nouveau (a code
  change that was meant to make this faster actually made it slower, and is
  disabled in this version by guarding it with an environment variable)

In addition, Marco Trevisan fixed the superficial autopkgtest for the -dev
package to use the correct SONAME for this version of mutter. Previously,
we were testing "cruft" packages left over from GNOME 3.36.

[ Tests ]
I've been using GNOME day-to-day in Wayland mode on my Intel-based laptop.
I've also tried it in X11 mode on the same laptop, and in X11 mode on a
desktop with the NVIDIA proprietary drivers, with no regressions observed.

[ Risks ]
mutter is part of our default desktop compositor (GNOME Shell), so any
regressions in it are high-visibility, but so are the bugs we're fixing
here. Upstream are generally good about only backporting genuine bug
fixes to their stable-branch, and fixing 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

unblock mutter/3.38.3-5
diffstat for mutter-3.38.3 mutter-3.38.3

 changelog                                                               |   31 ++
 patches/clutter-stage-view-Disable-double-buffered-shadow-bufferi.patch |   56 ++++
 patches/compositor-x11-Notify-the-sync-ring-about-frames-on-updat.patch |  109 +++++++++
 patches/core-Account-for-the-globally-active-input-case.patch           |   59 +++++
 patches/frame-Fix-crash-when-clicking-below-titlebar-with-broken-.patch |   41 +++
 patches/series                                                          |    6 
 patches/window-Add-is_focus_async-API.patch                             |  113 ++++++++++
 patches/window-actor-x11-Queue-full-actor-redraw-when-redraw-queu.patch |   56 ++++
 tests/control                                                           |    4 
 tests/libmutter-6-dev                                                   |   41 ---
 tests/libmutter-7-dev                                                   |   41 +++
 11 files changed, 514 insertions(+), 43 deletions(-)

diff -Nru mutter-3.38.3/debian/changelog mutter-3.38.3/debian/changelog
--- mutter-3.38.3/debian/changelog	2021-02-23 09:27:54.000000000 +0000
+++ mutter-3.38.3/debian/changelog	2021-03-10 09:37:00.000000000 +0000
@@ -1,3 +1,34 @@
+mutter (3.38.3-5) unstable; urgency=medium
+
+  * Team upload
+
+  [ Marco Trevisan (Treviño) ]
+  * debian/patches: Include a missing commit from upstream gnome-3-38
+    branch to fix X11 UI stutters
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 10 Mar 2021 09:37:00 +0000
+
+mutter (3.38.3-4) unstable; urgency=medium
+
+  * Team upload
+
+  [ Marco Trevisan (Treviño) ]
+  * debian/patches: cherry-pick more upstream gnome-3-38 fixes
+    - Correctly restore focus to applications that use globally active
+      input handling, such as AWT/Swing Java apps
+    - Disable double buffered shadow buffering, which was intended to
+      improve performance with e.g. llvmpipe but currently makes it worse
+  * debian/tests: Adapt autopkgtest name and linked library to current soname
+  * debian/tests/control: Update references to libmutter-7-dev
+
+  [ Simon McVittie ]
+  * d/patches: Update to commit 3.38.3-26-g30c542ddc from gnome-3-38 branch
+    - Fix X11 frame timing getting stuck if frames are skipped, resulting
+      in X11 applications not always being redrawn when they should be
+    - Fix a crash when clicking below titlebar with broken GTK themes
+
+ -- Simon McVittie <smcv@debian.org>  Tue, 09 Mar 2021 20:34:42 +0000
+
 mutter (3.38.3-3) unstable; urgency=medium
 
   * Team upload
diff -Nru mutter-3.38.3/debian/patches/clutter-stage-view-Disable-double-buffered-shadow-bufferi.patch mutter-3.38.3/debian/patches/clutter-stage-view-Disable-double-buffered-shadow-bufferi.patch
--- mutter-3.38.3/debian/patches/clutter-stage-view-Disable-double-buffered-shadow-bufferi.patch	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/patches/clutter-stage-view-Disable-double-buffered-shadow-bufferi.patch	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,56 @@
+From: =?utf-8?q?Jonas_=C3=85dahl?= <jadahl@gmail.com>
+Date: Wed, 10 Feb 2021 09:39:18 +0100
+Subject: clutter/stage-view: Disable double buffered shadow buffering
+
+To make the double buffered shadow buffer damaged tiles detection
+feasable, a new EGL extension is needed for creating FBO's backed by
+a custom CPU memory buffer, instead of DMA buffers, as DMA buffers can
+be very slow to read, much slower than just painting the shadow buffer
+directly.
+
+Leave the code there, since such an EGL extension is intended to be
+added, but hide it behind an env var so that it isn't enabled by
+accident.
+
+(cherry picked from commit ad5b5f2c57dd0dcb9e586ea09486eebff89fb94d)
+
+https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1724
+
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1743>
+
+Origin: https://gitlab.gnome.org/GNOME/mutter/-/commit/95b683ae
+---
+ clutter/clutter/clutter-stage-view.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
+index 00a4d5a..ccc07cd 100644
+--- a/clutter/clutter/clutter-stage-view.c
++++ b/clutter/clutter/clutter-stage-view.c
+@@ -415,15 +415,19 @@ init_shadowfb (ClutterStageView *view)
+   height = cogl_framebuffer_get_height (priv->framebuffer);
+   cogl_context = cogl_framebuffer_get_context (priv->framebuffer);
+ 
+-  if (init_dma_buf_shadowfbs (view, cogl_context, width, height, &error))
++  if (g_strcmp0 (g_getenv ("MUTTER_DEBUG_ENABLE_DOUBLE_SHADOWFB"), "1") == 0)
+     {
+-      g_message ("Initialized double buffered shadow fb for %s", priv->name);
+-      return;
+-    }
++      if (init_dma_buf_shadowfbs (view, cogl_context, width, height, &error))
++        {
++          g_message ("Initialized double buffered shadow fb for %s",
++                     priv->name);
++          return;
++        }
+ 
+-  g_warning ("Failed to initialize double buffered shadow fb for %s: %s",
+-             priv->name, error->message);
+-  g_clear_error (&error);
++      g_warning ("Failed to initialize double buffered shadow fb for %s: %s",
++                 priv->name, error->message);
++      g_clear_error (&error);
++    }
+ 
+   if (!init_fallback_shadowfb (view, cogl_context, width, height, &error))
+     {
diff -Nru mutter-3.38.3/debian/patches/compositor-x11-Notify-the-sync-ring-about-frames-on-updat.patch mutter-3.38.3/debian/patches/compositor-x11-Notify-the-sync-ring-about-frames-on-updat.patch
--- mutter-3.38.3/debian/patches/compositor-x11-Notify-the-sync-ring-about-frames-on-updat.patch	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/patches/compositor-x11-Notify-the-sync-ring-about-frames-on-updat.patch	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,109 @@
+From: =?utf-8?q?Jonas_=C3=85dahl?= <jadahl@gmail.com>
+Date: Thu, 4 Mar 2021 19:11:12 +0100
+Subject: compositor/x11: Notify the sync ring about frames on updates
+
+The sync ring has an API about "frames", where it is notified about
+the end of frames. However, its "insert wait" call is done before
+updates, meaning that some "insert waits" will never see the "after
+frame" if there was no frame drawn. This will cause mismatching in the
+frame counting, causing freezes in the synchronization until something
+else triggers an actual frame, effectively "unfreezing" the sync ring.
+
+Fix this by not only notifying the sync ring about frames when there
+were actual frames drawn, but also on plain updates which didn't result
+in a drawn frame.
+
+Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1516
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1754>
+(cherry picked from commit 44a4e616658edb2a21a9612cfd3a41742a1ca427)
+---
+ src/compositor/meta-compositor-x11.c | 35 ++++++++++++++++++-----------------
+ 1 file changed, 18 insertions(+), 17 deletions(-)
+
+diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c
+index e7da103..339ef03 100644
+--- a/src/compositor/meta-compositor-x11.c
++++ b/src/compositor/meta-compositor-x11.c
+@@ -40,6 +40,7 @@ struct _MetaCompositorX11
+   Window output;
+ 
+   gulong before_update_handler_id;
++  gulong after_update_handler_id;
+ 
+   gboolean frame_has_updated_xsurfaces;
+   gboolean have_x11_sync_object;
+@@ -363,35 +364,32 @@ on_before_update (ClutterStage     *stage,
+ }
+ 
+ static void
+-meta_compositor_x11_before_paint (MetaCompositor   *compositor,
+-                                  ClutterStageView *stage_view)
++on_after_update (ClutterStage     *stage,
++                 ClutterStageView *stage_view,
++                 MetaCompositor   *compositor)
+ {
+   MetaCompositorX11 *compositor_x11 = META_COMPOSITOR_X11 (compositor);
+-  MetaCompositorClass *parent_class;
+ 
+-  maybe_unredirect_top_window (compositor_x11);
++  if (compositor_x11->frame_has_updated_xsurfaces)
++    {
++      if (compositor_x11->have_x11_sync_object)
++        compositor_x11->have_x11_sync_object = meta_sync_ring_after_frame ();
+ 
+-  parent_class = META_COMPOSITOR_CLASS (meta_compositor_x11_parent_class);
+-  parent_class->before_paint (compositor, stage_view);
++      compositor_x11->frame_has_updated_xsurfaces = FALSE;
++    }
+ }
+ 
+ static void
+-meta_compositor_x11_after_paint (MetaCompositor   *compositor,
+-                                 ClutterStageView *stage_view)
++meta_compositor_x11_before_paint (MetaCompositor   *compositor,
++                                  ClutterStageView *stage_view)
+ {
+   MetaCompositorX11 *compositor_x11 = META_COMPOSITOR_X11 (compositor);
+   MetaCompositorClass *parent_class;
+ 
+-  if (compositor_x11->frame_has_updated_xsurfaces)
+-    {
+-      if (compositor_x11->have_x11_sync_object)
+-        compositor_x11->have_x11_sync_object = meta_sync_ring_after_frame ();
+-
+-      compositor_x11->frame_has_updated_xsurfaces = FALSE;
+-    }
++  maybe_unredirect_top_window (compositor_x11);
+ 
+   parent_class = META_COMPOSITOR_CLASS (meta_compositor_x11_parent_class);
+-  parent_class->after_paint (compositor, stage_view);
++  parent_class->before_paint (compositor, stage_view);
+ }
+ 
+ static void
+@@ -465,6 +463,9 @@ meta_compositor_x11_constructed (GObject *object)
+   compositor_x11->before_update_handler_id =
+     g_signal_connect (stage, "before-update",
+                       G_CALLBACK (on_before_update), compositor);
++  compositor_x11->after_update_handler_id =
++    g_signal_connect (stage, "after-update",
++                      G_CALLBACK (on_after_update), compositor);
+ 
+   G_OBJECT_CLASS (meta_compositor_x11_parent_class)->constructed (object);
+ }
+@@ -483,6 +484,7 @@ meta_compositor_x11_dispose (GObject *object)
+     }
+ 
+   g_clear_signal_handler (&compositor_x11->before_update_handler_id, stage);
++  g_clear_signal_handler (&compositor_x11->after_update_handler_id, stage);
+ 
+   G_OBJECT_CLASS (meta_compositor_x11_parent_class)->dispose (object);
+ }
+@@ -504,7 +506,6 @@ meta_compositor_x11_class_init (MetaCompositorX11Class *klass)
+   compositor_class->manage = meta_compositor_x11_manage;
+   compositor_class->unmanage = meta_compositor_x11_unmanage;
+   compositor_class->before_paint = meta_compositor_x11_before_paint;
+-  compositor_class->after_paint = meta_compositor_x11_after_paint;
+   compositor_class->remove_window = meta_compositor_x11_remove_window;
+   compositor_class->monotonic_to_high_res_xserver_time =
+    meta_compositor_x11_monotonic_to_high_res_xserver_time;
diff -Nru mutter-3.38.3/debian/patches/core-Account-for-the-globally-active-input-case.patch mutter-3.38.3/debian/patches/core-Account-for-the-globally-active-input-case.patch
--- mutter-3.38.3/debian/patches/core-Account-for-the-globally-active-input-case.patch	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/patches/core-Account-for-the-globally-active-input-case.patch	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,59 @@
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Mon, 8 Feb 2021 09:54:43 +0100
+Subject: core: Account for the globally active input case
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+Commit afa43154 tried to make sure the focus was properly changed when
+calling focus_default_window() by checking the focused window just after
+trying to set the focus.
+
+However, the X11 “Inter-Client Communication Conventions Manual” version
+2.0 (ICCCM 2 for short) states that some X11 client may want to use a so
+called “globally active input” model in which case the client expects
+keyboard input and set input focus even when it's not one of its own
+window.
+
+To comply with this, when dealing with such clients, mutter will not
+change the focus and send a WM_TAKE_FOCUS message instead.
+
+That mechanism will defeat the logic introduced by commit afa43154
+because the focused window is not changed in this case. As a result, the
+input focus will fallback to the no-focus window.
+
+To avoid this, only check that the focus change occurred for windows
+using a synchronous focus model.
+
+v2: Split specific test for "globally active input" model (Florian).
+v3: Remove the check for window->unmanaging which is useless (Jonas).
+
+Fixes: afa43154 - "core: Make sure focus_default_window() worked"
+Close: https://gitlab.gnome.org/GNOME/mutter/-/issues/1620
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1716>
+(cherry picked from commit 2432508db78a235abc5cee198fb94043625db65f)
+
+Origin: https://gitlab.gnome.org/GNOME/mutter/-/commit/2d34ee08
+---
+ src/core/workspace.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/core/workspace.c b/src/core/workspace.c
+index a80560b..a6edb5f 100644
+--- a/src/core/workspace.c
++++ b/src/core/workspace.c
+@@ -1367,6 +1367,14 @@ try_to_set_focus_and_check (MetaWindow *window,
+ {
+   meta_window_focus (window, timestamp);
+ 
++  /* meta_focus_window() will not change focus for clients using the
++   * "globally active input" model of input handling, hence defeating
++   * the assumption that focus should be changed for such windows.
++   * See https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
++   */
++  if (meta_window_is_focus_async (window))
++    return TRUE;
++
+   /* meta_window_focus() does not guarantee that focus will end up
+    * where we expect, it can fail for various reasons, better check
+    * it did not actually changed or even left focus to the window we
diff -Nru mutter-3.38.3/debian/patches/frame-Fix-crash-when-clicking-below-titlebar-with-broken-.patch mutter-3.38.3/debian/patches/frame-Fix-crash-when-clicking-below-titlebar-with-broken-.patch
--- mutter-3.38.3/debian/patches/frame-Fix-crash-when-clicking-below-titlebar-with-broken-.patch	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/patches/frame-Fix-crash-when-clicking-below-titlebar-with-broken-.patch	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,41 @@
+From: Sebastian Keller <skeller@gnome.org>
+Date: Sat, 27 Feb 2021 00:00:25 +0000
+Subject: frame: Fix crash when clicking below titlebar with broken gtk themes
+
+When a gtk theme uses larger shadows for the unfocused state than for
+the focused one, this can cause a crash in meta_frame_left_click_event.
+Since whether to call meta_frame_left_click_event is decided based on
+the decoration size before focusing and the control that was clicked on
+after focusing, this can result in an event handled in
+meta_frame_left_click_event being on the client area.
+
+Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1668
+
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1748>
+
+(cherry picked from commit c2968c89fef3d67f161cb01481a8a2939c45a425)
+(cherry picked from commit 30c542ddc3f73aa625c5f88167da6700c45b9f33)
+---
+ src/ui/frames.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/ui/frames.c b/src/ui/frames.c
+index 5cbfb09..5e39616 100644
+--- a/src/ui/frames.c
++++ b/src/ui/frames.c
+@@ -1112,6 +1112,15 @@ meta_frame_left_click_event (MetaUIFrame        *frame,
+        * that cannot be resized (e. g. it is maximized and the theme
+        * currently used has borders for maximized windows), see #751884 */
+       return FALSE;
++    case META_FRAME_CONTROL_CLIENT_AREA:
++      /* This can happen with broken gtk themes that have a larger shadow size
++       * in the unfocused state than in the focused one. Then when clicking
++       * below the titlebar area in the unfocused state would still be
++       * considered a click on the titlebar due to it being shifted down because
++       * of the shadow. This then causes the window to be focused before this
++       * function is called, which removes the shadow such that the same
++       * position is now considered to be on the client area */
++      return FALSE;
+     default:
+       g_assert_not_reached ();
+       return FALSE;
diff -Nru mutter-3.38.3/debian/patches/series mutter-3.38.3/debian/patches/series
--- mutter-3.38.3/debian/patches/series	2021-02-23 09:27:54.000000000 +0000
+++ mutter-3.38.3/debian/patches/series	2021-03-10 09:37:00.000000000 +0000
@@ -18,6 +18,12 @@
 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 -Nru mutter-3.38.3/debian/patches/window-actor-x11-Queue-full-actor-redraw-when-redraw-queu.patch mutter-3.38.3/debian/patches/window-actor-x11-Queue-full-actor-redraw-when-redraw-queu.patch
--- mutter-3.38.3/debian/patches/window-actor-x11-Queue-full-actor-redraw-when-redraw-queu.patch	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/patches/window-actor-x11-Queue-full-actor-redraw-when-redraw-queu.patch	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,56 @@
+From: =?utf-8?q?Jonas_=C3=85dahl?= <jadahl@gmail.com>
+Date: Fri, 5 Mar 2021 09:55:34 +0100
+Subject: window-actor/x11: Queue full actor redraw when redraw queued
+
+With frame timings, we might end up in a situation where a frame drawn
+is expected, but no damage was posted. Up until now, mutter handled
+this, if the window wasn't completely hidden, by posting a 1x1 pixel
+damage region. The problem with this is that we now are a bit more
+aggressive optimizing away no-op redraws, meaning we still might end up
+not drawing, making things get stuck.
+
+Fix this by doing a full actor redraw, as that is the only reliable way
+to both a new frame being drawn, as well as the actor in question itself
+getting redrawn.
+
+Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1516
+Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3369
+Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1471
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1754>
+(cherry picked from commit 9b90b5a1b0856144d21e1a70e306d3f769a2e2f0)
+(cherry picked from commit 894a6d0935e61398e246482ebff423e3ad84d50f)
+---
+ src/compositor/meta-window-actor-x11.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
+index 6764877..e4e579e 100644
+--- a/src/compositor/meta-window-actor-x11.c
++++ b/src/compositor/meta-window-actor-x11.c
+@@ -483,10 +483,12 @@ meta_window_actor_x11_queue_frame_drawn (MetaWindowActor *actor,
+        * damage or any unobscured, or while we had the window frozen
+        * (e.g. during an interactive resize.) We need to make sure that the
+        * before_paint/after_paint functions get called, enabling us to
+-       * send a _NET_WM_FRAME_DRAWN. We do a 1-pixel redraw to get
+-       * consistent timing with non-empty frames. If the window
+-       * is completely obscured, or completely off screen we fire off the
+-       * send_frame_messages timeout.
++       * send a _NET_WM_FRAME_DRAWN. We need to do full damage to ensure that
++       * the window is actually repainted, otherwise any subregion we would pass
++       * might end up being either outside of any stage view, or be occluded by
++       * something else, which could potentially result in no frame being drawn
++       * after all. If the window is completely obscured, or completely off
++       * screen we fire off the send_frame_messages timeout.
+        */
+       if (is_obscured ||
+           !clutter_actor_peek_stage_views (CLUTTER_ACTOR (actor)))
+@@ -495,8 +497,7 @@ meta_window_actor_x11_queue_frame_drawn (MetaWindowActor *actor,
+         }
+       else if (surface)
+         {
+-          const cairo_rectangle_int_t clip = { 0, 0, 1, 1 };
+-          clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (surface), &clip);
++          clutter_actor_queue_redraw (CLUTTER_ACTOR (surface));
+           actor_x11->repaint_scheduled = TRUE;
+         }
+     }
diff -Nru mutter-3.38.3/debian/patches/window-Add-is_focus_async-API.patch mutter-3.38.3/debian/patches/window-Add-is_focus_async-API.patch
--- mutter-3.38.3/debian/patches/window-Add-is_focus_async-API.patch	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/patches/window-Add-is_focus_async-API.patch	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,113 @@
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Thu, 11 Feb 2021 17:53:59 +0100
+Subject: window: Add "is_focus_async" API
+
+X11 clients can use different models of input handling, of which some
+may not result focus being set synchronously.
+
+For such clients, meta_focus_window() will not change the focus itself
+but rely on the client itself to set the input focus on the desired
+window.
+
+Add a new MetaWindow API to check when dealing with such a window.
+
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1716>
+(cherry picked from commit 6438919a89a4d0a0430321bedd68689a2c2f6e90)
+
+Origin: https://gitlab.gnome.org/GNOME/mutter/-/commit/cb7ac99f
+---
+ src/core/window-private.h         |  2 ++
+ src/core/window.c                 |  6 ++++++
+ src/wayland/meta-window-wayland.c |  7 +++++++
+ src/x11/window-x11.c              | 11 +++++++++++
+ 4 files changed, 26 insertions(+)
+
+diff --git a/src/core/window-private.h b/src/core/window-private.h
+index 3872479..1d7ec70 100644
+--- a/src/core/window-private.h
++++ b/src/core/window-private.h
+@@ -602,6 +602,7 @@ struct _MetaWindowClass
+   gboolean (*is_stackable)        (MetaWindow *window);
+   gboolean (*can_ping)            (MetaWindow *window);
+   gboolean (*are_updates_frozen)  (MetaWindow *window);
++  gboolean (*is_focus_async)      (MetaWindow *window);
+ 
+   MetaStackLayer (*calculate_layer) (MetaWindow *window);
+ 
+@@ -872,4 +873,5 @@ void meta_window_force_restore_shortcuts (MetaWindow         *window,
+ gboolean meta_window_shortcuts_inhibited (MetaWindow         *window,
+                                           ClutterInputDevice *source);
+ gboolean meta_window_is_stackable (MetaWindow *window);
++gboolean meta_window_is_focus_async (MetaWindow *window);
+ #endif
+diff --git a/src/core/window.c b/src/core/window.c
+index 3180d15..e1c58fc 100644
+--- a/src/core/window.c
++++ b/src/core/window.c
+@@ -8589,6 +8589,12 @@ meta_window_is_stackable (MetaWindow *window)
+   return META_WINDOW_GET_CLASS (window)->is_stackable (window);
+ }
+ 
++gboolean
++meta_window_is_focus_async (MetaWindow *window)
++{
++  return META_WINDOW_GET_CLASS (window)->is_focus_async (window);
++}
++
+ MetaStackLayer
+ meta_window_calculate_layer (MetaWindow *window)
+ {
+diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
+index 89ee0c2..45b79ec 100644
+--- a/src/wayland/meta-window-wayland.c
++++ b/src/wayland/meta-window-wayland.c
+@@ -724,6 +724,12 @@ meta_window_wayland_are_updates_frozen (MetaWindow *window)
+   return !wl_window->has_been_shown;
+ }
+ 
++static gboolean
++meta_window_wayland_is_focus_async (MetaWindow *window)
++{
++  return FALSE;
++}
++
+ static MetaStackLayer
+ meta_window_wayland_calculate_layer (MetaWindow *window)
+ {
+@@ -780,6 +786,7 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
+   window_class->calculate_layer = meta_window_wayland_calculate_layer;
+   window_class->map = meta_window_wayland_map;
+   window_class->unmap = meta_window_wayland_unmap;
++  window_class->is_focus_async = meta_window_wayland_is_focus_async;
+ }
+ 
+ MetaWindow *
+diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
+index 980a151..c0c8734 100644
+--- a/src/x11/window-x11.c
++++ b/src/x11/window-x11.c
+@@ -2058,6 +2058,16 @@ meta_window_x11_impl_always_update_shape (MetaWindow *window)
+   return FALSE;
+ }
+ 
++static gboolean
++meta_window_x11_is_focus_async (MetaWindow *window)
++{
++  MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
++  MetaWindowX11Private *priv =
++    meta_window_x11_get_instance_private (window_x11);
++
++  return !window->input && priv->wm_take_focus;
++}
++
+ static void
+ meta_window_x11_class_init (MetaWindowX11Class *klass)
+ {
+@@ -2088,6 +2098,7 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
+   window_class->calculate_layer = meta_window_x11_calculate_layer;
+   window_class->map = meta_window_x11_map;
+   window_class->unmap = meta_window_x11_unmap;
++  window_class->is_focus_async = meta_window_x11_is_focus_async;
+ 
+   klass->freeze_commits = meta_window_x11_impl_freeze_commits;
+   klass->thaw_commits = meta_window_x11_impl_thaw_commits;
diff -Nru mutter-3.38.3/debian/tests/control mutter-3.38.3/debian/tests/control
--- mutter-3.38.3/debian/tests/control	2021-02-23 09:27:54.000000000 +0000
+++ mutter-3.38.3/debian/tests/control	2021-03-10 09:37:00.000000000 +0000
@@ -1,7 +1,7 @@
-Tests: libmutter-6-dev
+Tests: libmutter-7-dev
 Depends: build-essential,
          dbus,
-         libmutter-6-dev,
+         libmutter-7-dev,
          xauth,
          xvfb
 Restrictions: allow-stderr superficial
diff -Nru mutter-3.38.3/debian/tests/libmutter-6-dev mutter-3.38.3/debian/tests/libmutter-6-dev
--- mutter-3.38.3/debian/tests/libmutter-6-dev	2021-02-23 09:27:54.000000000 +0000
+++ mutter-3.38.3/debian/tests/libmutter-6-dev	1970-01-01 01:00:00.000000000 +0100
@@ -1,41 +0,0 @@
-#!/bin/sh
-# autopkgtest check: Build and run a program against libmutter, to verify
-# that the headers and pkg-config file are installed correctly
-# (C) 2012 Canonical Ltd.
-# (C) 2018-2019 Simon McVittie
-# Authors: Martin Pitt, Simon McVittie
-
-set -eux
-
-WORKDIR=$(mktemp -d)
-export HOME="$WORKDIR"
-export XDG_RUNTIME_DIR="$WORKDIR"
-cleanup () {
-    rm -fr "$WORKDIR"
-}
-trap cleanup 0 INT QUIT ABRT PIPE TERM
-cd "$WORKDIR"
-
-if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
-    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
-else
-    CROSS_COMPILE=
-fi
-
-cat <<'EOF' > trivial.c
-#include <meta/util.h>
-
-int main(void)
-{
-    g_assert_false(meta_is_wayland_compositor());
-    return 0;
-}
-EOF
-
-# Deliberately word-splitting pkg-config's output:
-# shellcheck disable=SC2046
-"${CROSS_COMPILE}gcc" -o trivial trivial.c $("${CROSS_COMPILE}pkg-config" --cflags --libs libmutter-6)
-echo "build: OK"
-[ -x trivial ]
-xvfb-run -a dbus-run-session -- ./trivial
-echo "run: OK"
diff -Nru mutter-3.38.3/debian/tests/libmutter-7-dev mutter-3.38.3/debian/tests/libmutter-7-dev
--- mutter-3.38.3/debian/tests/libmutter-7-dev	1970-01-01 01:00:00.000000000 +0100
+++ mutter-3.38.3/debian/tests/libmutter-7-dev	2021-03-10 09:37:00.000000000 +0000
@@ -0,0 +1,41 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libmutter, to verify
+# that the headers and pkg-config file are installed correctly
+# (C) 2012 Canonical Ltd.
+# (C) 2018-2019 Simon McVittie
+# Authors: Martin Pitt, Simon McVittie
+
+set -eux
+
+WORKDIR=$(mktemp -d)
+export HOME="$WORKDIR"
+export XDG_RUNTIME_DIR="$WORKDIR"
+cleanup () {
+    rm -fr "$WORKDIR"
+}
+trap cleanup 0 INT QUIT ABRT PIPE TERM
+cd "$WORKDIR"
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+    CROSS_COMPILE=
+fi
+
+cat <<'EOF' > trivial.c
+#include <meta/util.h>
+
+int main(void)
+{
+    g_assert_false(meta_is_wayland_compositor());
+    return 0;
+}
+EOF
+
+# Deliberately word-splitting pkg-config's output:
+# shellcheck disable=SC2046
+"${CROSS_COMPILE}gcc" -o trivial trivial.c $("${CROSS_COMPILE}pkg-config" --cflags --libs libmutter-7)
+echo "build: OK"
+[ -x trivial ]
+xvfb-run -a dbus-run-session -- ./trivial
+echo "run: OK"

--- End Message ---
--- Begin Message ---
Unblocked mutter.

--- End Message ---

Reply to: