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

Bug#985407: unblock: gnome-shell/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 gnome-shell from our current heavily-patched 3.38.3
(effectively 3.38.4~git20210306) to the upstream 3.38.4 release.

[ Reason ]
* Multiple bug fixes around X11 windows' fallback icons:
  - a Shell crash that might have been a regression in our 3.38.3-3
  - missing icons for some programs that should have had them, particularly
    in programs that are not installed system-wide (such as Steam games),
    a regression since buster
  - a memory leak
  - a possible (although unlikely?) use-after-free
* Avoid repositioning of unrelated windows when a window is dragged onto
  the workspace switcher
* Make sure the blur effect shader compiles successfully by changing an
  integer literal to a floating-point literal
* Ship a real upstream release instead of what's effectively a git snapshot

[ Impact ]
The fixes for fallback icons include fixing a Shell crash. Because the Shell
acts as a Wayland compositor, crashes are extremely disruptive (ending the
session immediately, with no opportunity to save unsaved documents etc.)

The window positioning change is mostly cosmetic, but it seems better to
have it than to revert it. I think the blur effect change is similar.

Shipping 3.38.4 instead of 3.38.4~git20210306 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 gnome-shell/3.38.4-1
git diff archive/debian/3.38.3-4..patch-queue/debian/master \
| filterdiff -p1 --exclude='debian/patches/*.patch'

diff --git a/NEWS b/NEWS
index e541e2b2f..5841acd71 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+3.38.4
+======
+* Fix stuck grab after failed area screenshots [Sebastian; !1600]
+* Prefer image-data hint over app-icon in notifications [Guilherme; !1616]
+* Make sure fullscreen apps can't block the workspace switch animation
+  [Razze; #3636]
+* Fix stuck polkit dialog when using non-password auth [Florian; !1662]
+* Fix glitch after dragging window preview from second monitor [Ivan; !1727]
+* Fix missing X11 fallback icons [Florian; !1761]
+* Fixed crashes [Jonas D., Carlos, Sebastian; !1673, !1672, !1718]
+* Misc. bug fixes and cleanups [Florian, Marco, Abderrahim, Frederic; !1595,
+  !1598, !1635, !1725, !1750]
+
+Contributors:
+  Frederic Crozat, Jonas Dreßler, Carlos Garnacho, Sebastian Keller,
+  Abderrahim Kitouni, Ivan Molodetskikh, Florian Müllner, Razze,
+  Guilherme Silva, Marco Trevisan (Treviño)
+
+Translators:
+  Philipp Kiemle [de]
+
 3.38.3
 ======
 * Fix disappearing app grid [Georges; !1532]
diff --git a/debian/changelog b/debian/changelog
index 92d15a9d9..9af941dd9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+gnome-shell (3.38.4-1) unstable; urgency=medium
+
+  * Team upload
+  * New upstream release
+    - Fix missing X11 fallback icons (particularly for games and other
+      programs not installed system-wide), a regression in 3.37.3
+    - Fix a Shell crash when an X11 window with an invalid/empty icon
+      is closed, possibly a regression in 3.38.3-3
+    - Fix a memory leak when getting the icon from the texture cache
+    - Fix a possible use-after-free when removing a window
+    - Don't reposition unrelated windows when dragging a window onto the
+      workspace switcher
+    - Make sure the blur effect shader can be compiled successfully
+    - Many other fixes that we already had via debian/patches
+  * Drop all patches, applied upstream
+
+ -- Simon McVittie <smcv@debian.org>  Wed, 17 Mar 2021 09:52:47 +0000
+
 gnome-shell (3.38.3-4) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 8e6a9d6c1..000000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,11 +0,0 @@
-extensionSystem-Fix-opening-Extensions-app-from-notificat.patch
-workspacesView-Fix-off-by-one-error.patch
-screenshot-Still-remove-select-pick-actor-if-grab-promise.patch
-notificationDaemon-Fix-icon-choosing-logic.patch
-workspaceAnimation-Disable-unredirection-during-the-gestu.patch
-appDisplay-Do-not-bind-popdown-call-to-grabHelper-onUngra.patch
-polkitAgent-Ensure-cleanup-if-dialog-wasn-t-shown.patch
-blur-effect-Don-t-use-stage-view-when-drawing-off-stage.patch
-st-Keep-weak-ref-on-texture-cache-bound-texture-source.patch
-js-Require-Soup-2.4.patch
-Update-German-translation.patch
diff --git a/js/ui/ctrlAltTab.js b/js/ui/ctrlAltTab.js
index 46c2a7bf0..fbc7a0f5f 100644
--- a/js/ui/ctrlAltTab.js
+++ b/js/ui/ctrlAltTab.js
@@ -93,9 +93,10 @@ var CtrlAltTabManager = class CtrlAltTabManager {
                     if (app) {
                         icon = app.create_icon_texture(POPUP_APPICON_SIZE);
                     } else {
-                        icon = textureCache.bind_cairo_surface_property(windows[i],
-                                                                        'icon',
-                                                                        POPUP_APPICON_SIZE);
+                        icon = new St.Icon({
+                            gicon: textureCache.bind_cairo_surface_property(windows[i], 'icon'),
+                            icon_size: POPUP_APPICON_SIZE,
+                        });
                     }
                 }
 
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 04ffc99ca..6cd6a985c 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -736,8 +736,9 @@ var WorkspaceLayout = GObject.registerClass({
 
         // The layout might be frozen and we might not update the windowSlots
         // on the next allocation, so remove the slot now already
-        this._windowSlots.splice(
-            this._windowSlots.findIndex(s => s[4] === window), 1);
+        const index = this._windowSlots.findIndex(s => s[4] === window);
+        if (index !== -1)
+            this._windowSlots.splice(index, 1);
 
         // The window might have been reparented by DND
         if (window.get_parent() === this._container)
diff --git a/meson.build b/meson.build
index 65ee61611..5dfa0d0db 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('gnome-shell', 'c',
-  version: '3.38.3',
+  version: '3.38.4',
   meson_version: '>= 0.53.0',
   license: 'GPLv2+'
 )
diff --git a/src/shell-app.c b/src/shell-app.c
index 6cf4cbaf6..75a83d347 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -38,6 +38,8 @@ typedef struct {
   /* Signal connection to dirty window sort list on workspace changes */
   gulong workspace_switch_id;
 
+  gulong icon_changed_id;
+
   GSList *windows;
 
   guint interesting_windows;
@@ -93,6 +95,7 @@ enum {
   PROP_ID,
   PROP_DBUS_ID,
   PROP_ACTION_GROUP,
+  PROP_ICON,
   PROP_APP_INFO
 };
 
@@ -127,6 +130,9 @@ shell_app_get_property (GObject    *gobject,
     case PROP_ID:
       g_value_set_string (value, shell_app_get_id (app));
       break;
+    case PROP_ICON:
+      g_value_set_object (value, shell_app_get_icon (app));
+      break;
     case PROP_ACTION_GROUP:
       if (app->running_state)
         g_value_set_object (value, app->running_state->muxer);
@@ -181,6 +187,32 @@ window_backed_app_get_window (ShellApp     *app)
     return NULL;
 }
 
+static GIcon *
+x11_window_create_fallback_gicon (MetaWindow *window)
+{
+  StTextureCache *texture_cache;
+  cairo_surface_t *surface;
+
+  g_object_get (window, "icon", &surface, NULL);
+
+  texture_cache = st_texture_cache_get_default ();
+  return st_texture_cache_load_cairo_surface_to_gicon (texture_cache, surface);
+}
+
+static void
+on_window_icon_changed (GObject          *object,
+                        const GParamSpec *pspec,
+                        gpointer          user_data)
+{
+  MetaWindow *window = META_WINDOW (object);
+  ShellApp *app = user_data;
+
+  g_clear_object (&app->fallback_icon);
+  app->fallback_icon = x11_window_create_fallback_gicon (window);
+
+  g_object_notify (G_OBJECT (app), "icon");
+}
+
 /**
  * shell_app_get_icon:
  *
@@ -211,10 +243,10 @@ shell_app_get_icon (ShellApp *app)
   if (window &&
       meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_X11)
     {
-      app->fallback_icon =
-        st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
-                                                      G_OBJECT (window),
-                                                      "icon");
+      app->fallback_icon = x11_window_create_fallback_gicon (window);
+      app->running_state->icon_changed_id =
+        g_signal_connect (G_OBJECT (window),
+                         "notify::icon", G_CALLBACK (on_window_icon_changed), app);
     }
   else
     {
@@ -236,15 +268,13 @@ ClutterActor *
 shell_app_create_icon_texture (ShellApp   *app,
                                int         size)
 {
-  GIcon *icon;
   ClutterActor *ret;
 
   ret = st_icon_new ();
   st_icon_set_icon_size (ST_ICON (ret), size);
   st_icon_set_fallback_icon_name (ST_ICON (ret), "application-x-executable");
 
-  icon = shell_app_get_icon (app);
-  st_icon_set_gicon (ST_ICON (ret), icon);
+  g_object_bind_property (app, "icon", ret, "gicon", G_BINDING_SYNC_CREATE);
 
   if (shell_app_is_window_backed (app))
     st_widget_add_style_class_name (ST_WIDGET (ret), "fallback-app-icon");
@@ -1111,13 +1141,16 @@ _shell_app_remove_window (ShellApp   *app,
   g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_unmanaged), app);
   g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_user_time_changed), app);
   g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_skip_taskbar_changed), app);
-  g_object_unref (window);
   app->running_state->windows = g_slist_remove (app->running_state->windows, window);
 
+  g_clear_signal_handler (&app->running_state->icon_changed_id, window);
+
   if (!meta_window_is_skip_taskbar (window))
     app->running_state->interesting_windows--;
   shell_app_sync_running_state (app);
 
+  g_object_unref (window);
+
   if (app->running_state->windows == NULL)
     g_clear_pointer (&app->running_state, unref_running_state);
 
@@ -1641,6 +1674,19 @@ shell_app_class_init(ShellAppClass *klass)
                                                         NULL,
                                                         G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
+  /**
+   * ShellApp:icon:
+   *
+   * The #GIcon representing this ShellApp
+   */
+  g_object_class_install_property (gobject_class,
+                                   PROP_ICON,
+                                   g_param_spec_object ("icon",
+                                                        "GIcon",
+                                                        "The GIcon representing this app",
+                                                        G_TYPE_ICON,
+                                                        G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
   /**
    * ShellApp:action-group:
    *
diff --git a/src/shell-blur-effect.c b/src/shell-blur-effect.c
index ca645112a..fca4d011c 100644
--- a/src/shell-blur-effect.c
+++ b/src/shell-blur-effect.c
@@ -99,7 +99,7 @@ static const gchar *gaussian_blur_glsl =
 "  vec4 ret = texture2D (cogl_sampler, uv) * gauss_coefficient.x;          \n"
 "  gauss_coefficient.xy *= gauss_coefficient.yz;                           \n"
 "                                                                          \n"
-"  int n_steps = int (ceil (3 * sigma));                                   \n"
+"  int n_steps = int (ceil (3.0 * sigma));                                 \n"
 "                                                                          \n"
 "  for (int i = 1; i < n_steps; i += 2) {                                  \n"
 "    float coefficient_subtotal = gauss_coefficient.x;                     \n"
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index abb2cf9d2..ab408ea15 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -742,12 +742,10 @@ typedef struct {
 } StTextureCachePropertyBind;
 
 static void
-st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
-                                const char                 *propname)
+st_texture_cache_load_surface (ClutterContent  **image,
+                               cairo_surface_t  *surface)
 {
-  cairo_surface_t *surface;
-
-  g_object_get (bind->source, propname, &surface, NULL);
+  g_return_if_fail (image != NULL);
 
   if (surface != NULL &&
       cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE &&
@@ -761,10 +759,10 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
       height = cairo_image_surface_get_width (surface);
       size = MAX(width, height);
 
-      if (!bind->image)
-        bind->image = st_image_content_new_with_preferred_size (size, size);
+      if (*image == NULL)
+        *image = st_image_content_new_with_preferred_size (size, size);
 
-      clutter_image_set_data (CLUTTER_IMAGE (bind->image),
+      clutter_image_set_data (CLUTTER_IMAGE (*image),
                               cairo_image_surface_get_data (surface),
                               cairo_image_surface_get_format (surface) == CAIRO_FORMAT_ARGB32 ?
                               COGL_PIXEL_FORMAT_BGRA_8888 : COGL_PIXEL_FORMAT_BGR_888,
@@ -776,11 +774,21 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
       if (error)
         g_warning ("Failed to allocate texture: %s", error->message);
     }
-  else
-    bind->image = g_object_new (ST_TYPE_IMAGE_CONTENT,
-                                "preferred-width", 0, /* tough luck */
-                                "preferred-height", 0,
-                                NULL);
+  else if (*image == NULL)
+    {
+      *image = st_image_content_new_with_preferred_size (0, 0);
+    }
+}
+
+static void
+st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
+                                const char                 *propname)
+{
+  cairo_surface_t *surface;
+
+  g_object_get (bind->source, propname, &surface, NULL);
+
+  st_texture_cache_load_surface (&bind->image, surface);
 }
 
 static void
@@ -798,10 +806,6 @@ st_texture_cache_bind_weak_notify (gpointer     data,
 {
   StTextureCachePropertyBind *bind = data;
   bind->weakref_active = FALSE;
-  if (G_OBJECT (bind->image) != source_location)
-    g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-  if (bind->source != source_location)
-    g_object_weak_unref (G_OBJECT (bind->source), st_texture_cache_bind_weak_notify, bind);
   g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
 }
 
@@ -809,13 +813,8 @@ static void
 st_texture_cache_free_bind (gpointer data)
 {
   StTextureCachePropertyBind *bind = data;
-
   if (bind->weakref_active)
-    {
-      g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-      g_object_weak_unref (G_OBJECT (bind->source), st_texture_cache_bind_weak_notify, bind);
-    }
-
+    g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
   g_slice_free (StTextureCachePropertyBind, bind);
 }
 
@@ -832,7 +831,7 @@ st_texture_cache_free_bind (gpointer data)
  * If the source object is destroyed, the texture will continue to show the last
  * value of the property.
  *
- * Returns: (transfer none): A new #GIcon
+ * Returns: (transfer full): A new #GIcon
  */
 GIcon *
 st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
@@ -849,7 +848,6 @@ st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
   st_texture_cache_reset_texture (bind, property_name);
 
   g_object_weak_ref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-  g_object_weak_ref (G_OBJECT (bind->source), st_texture_cache_bind_weak_notify, bind);
   bind->weakref_active = TRUE;
 
   notify_key = g_strdup_printf ("notify::%s", property_name);
@@ -860,6 +858,25 @@ st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
   return G_ICON (bind->image);
 }
 
+/**
+ * st_texture_cache_load_cairo_surface_to_gicon:
+ * @cache: A #StTextureCache
+ * @surface: A #cairo_surface_t
+ *
+ * Create a #GIcon from @surface.
+ *
+ * Returns: (transfer full): A new #GIcon
+ */
+GIcon *
+st_texture_cache_load_cairo_surface_to_gicon (StTextureCache  *cache,
+                                              cairo_surface_t *surface)
+{
+  ClutterContent *image = NULL;
+  st_texture_cache_load_surface (&image, surface);
+
+  return G_ICON (image);
+}
+
 /**
  * st_texture_cache_load: (skip)
  * @cache: A #StTextureCache
@@ -994,6 +1011,15 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
 
   if (ST_IS_IMAGE_CONTENT (icon))
     {
+      int width, height;
+
+      g_object_get (G_OBJECT (icon),
+                    "preferred-width", &width,
+                    "preferred-height", &height,
+                    NULL);
+      if (width == 0 && height == 0)
+        return NULL;
+
       return g_object_new (CLUTTER_TYPE_ACTOR,
                            "request-mode", CLUTTER_REQUEST_CONTENT_SIZE,
                            "width", actor_size,
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
index 0e8407ea2..55d84952d 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -67,6 +67,9 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
 GIcon *st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
                                                      GObject           *object,
                                                      const char *property_name);
+GIcon *
+st_texture_cache_load_cairo_surface_to_gicon (StTextureCache  *cache,
+                                              cairo_surface_t *surface);
 
 ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
                                            StThemeNode    *theme_node,
diff --git a/subprojects/extensions-app/data/metainfo/org.gnome.Extensions.metainfo.xml.in b/subprojects/extensions-app/data/metainfo/org.gnome.Extensions.metainfo.xml.in
index 2a532bc32..c742154a7 100644
--- a/subprojects/extensions-app/data/metainfo/org.gnome.Extensions.metainfo.xml.in
+++ b/subprojects/extensions-app/data/metainfo/org.gnome.Extensions.metainfo.xml.in
@@ -39,6 +39,7 @@
   </description>
 
   <releases>
+    <release version="3.38.4" date="2021-03-15"/>
     <release version="3.38.3" date="2021-01-14"/>
     <release version="3.38.2" date="2020-12-02"/>
     <release version="3.38.1" date="2020-10-05"/>
diff --git a/subprojects/extensions-app/meson.build b/subprojects/extensions-app/meson.build
index 353dfa3f8..31843a452 100644
--- a/subprojects/extensions-app/meson.build
+++ b/subprojects/extensions-app/meson.build
@@ -1,5 +1,5 @@
 project('gnome-extensions-app',
-  version: '3.38.3',
+  version: '3.38.4',
   meson_version: '>= 0.53.0',
   license: 'GPLv2+'
 )
diff --git a/subprojects/extensions-tool/meson.build b/subprojects/extensions-tool/meson.build
index 8ec4b8910..cb62774ce 100644
--- a/subprojects/extensions-tool/meson.build
+++ b/subprojects/extensions-tool/meson.build
@@ -1,5 +1,5 @@
 project('gnome-extensions-tool', 'c',
-  version: '3.38.3',
+  version: '3.38.4',
   meson_version: '>= 0.53.0',
   license: 'GPLv2+'
 )
diff --git a/subprojects/shew/meson.build b/subprojects/shew/meson.build
index 6b9f4c61d..db26b3624 100644
--- a/subprojects/shew/meson.build
+++ b/subprojects/shew/meson.build
@@ -1,5 +1,5 @@
 project('shew', 'c',
-  version: '3.38.3',
+  version: '3.38.4',
   meson_version: '>= 0.53.0',
   license: 'LGPLv2+',
 )

Reply to: