Blame SOURCES/fix-some-js-warnings.patch

1bd53d
From 05a5f4641c8ad6337ccb46e63abcaf27dd7eb852 Mon Sep 17 00:00:00 2001
1bd53d
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1bd53d
Date: Tue, 9 Jun 2020 19:42:21 +0200
1bd53d
Subject: [PATCH 1/4] popupMenu: Guard against non-menu-item children
1bd53d
1bd53d
This avoid a harmless but annoying warning.
1bd53d
---
1bd53d
 js/ui/popupMenu.js | 3 ++-
1bd53d
 1 file changed, 2 insertions(+), 1 deletion(-)
1bd53d
1bd53d
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
1bd53d
index 11528560d..144c600d7 100644
1bd53d
--- a/js/ui/popupMenu.js
1bd53d
+++ b/js/ui/popupMenu.js
1bd53d
@@ -773,7 +773,8 @@ var PopupMenuBase = class {
1bd53d
     }
1bd53d
 
1bd53d
     _getMenuItems() {
1bd53d
-        return this.box.get_children().map(a => a._delegate).filter(item => {
1bd53d
+        const children = this.box.get_children().filter(a => a._delegate !== undefined);
1bd53d
+        return children.map(a => a._delegate).filter(item => {
1bd53d
             return item instanceof PopupBaseMenuItem || item instanceof PopupMenuSection;
1bd53d
         });
1bd53d
     }
1bd53d
-- 
1bd53d
2.31.1
1bd53d
1bd53d
1bd53d
From e5b2c2b3cfd0443fa83fd1f6f56f65fefa5186c3 Mon Sep 17 00:00:00 2001
1bd53d
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1bd53d
Date: Tue, 9 Jun 2020 19:48:06 +0200
1bd53d
Subject: [PATCH 2/4] st/shadow: Check pipeline when painting
1bd53d
1bd53d
We shouldn't simply assume that st_shadow_helper_update() has been
1bd53d
called before paint() or that the pipeline was created successfully.
1bd53d
---
1bd53d
 src/st/st-shadow.c | 11 ++++++-----
1bd53d
 1 file changed, 6 insertions(+), 5 deletions(-)
1bd53d
1bd53d
diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c
1bd53d
index ab3eaa856..d53808698 100644
1bd53d
--- a/src/st/st-shadow.c
1bd53d
+++ b/src/st/st-shadow.c
1bd53d
@@ -296,9 +296,10 @@ st_shadow_helper_paint (StShadowHelper  *helper,
1bd53d
                         ClutterActorBox *actor_box,
1bd53d
                         guint8           paint_opacity)
1bd53d
 {
1bd53d
-  _st_paint_shadow_with_opacity (helper->shadow,
1bd53d
-                                 framebuffer,
1bd53d
-                                 helper->pipeline,
1bd53d
-                                 actor_box,
1bd53d
-                                 paint_opacity);
1bd53d
+  if (helper->pipeline != NULL)
1bd53d
+    _st_paint_shadow_with_opacity (helper->shadow,
1bd53d
+                                   framebuffer,
1bd53d
+                                   helper->pipeline,
1bd53d
+                                   actor_box,
1bd53d
+                                   paint_opacity);
1bd53d
 }
1bd53d
-- 
1bd53d
2.31.1
1bd53d
1bd53d
1bd53d
From 0f7656d85af51339d14217b9a673442a18df3de8 Mon Sep 17 00:00:00 2001
1bd53d
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1bd53d
Date: Thu, 8 Jul 2021 19:10:05 +0200
1bd53d
Subject: [PATCH 3/4] messageTray: Always remove destroyed banners
1bd53d
1bd53d
Currently we only mark the banner as removed if it is destroyed
1bd53d
while in SHOWN or SHOWING state, but not if we're already HIDING
1bd53d
(for example in response to `NotificationBanner::done-displaying`).
1bd53d
1bd53d
If this happens, we'll try to destroy the notification again at
1bd53d
the end of the transition, which leads to (harmless but annoying)
1bd53d
log spam since Notifications were turned into GObjects (that are
1bd53d
disposed when destroyed).
1bd53d
1bd53d
Address this by always marking destroyed banners as removed, while
1bd53d
still only triggering a state update while shown (or in the process
1bd53d
of being shown).
1bd53d
1bd53d
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4457
1bd53d
---
1bd53d
 js/ui/messageTray.js | 23 +++++++++++++----------
1bd53d
 1 file changed, 13 insertions(+), 10 deletions(-)
1bd53d
1bd53d
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
1bd53d
index 1dab00a70..ccf56fc5b 100644
1bd53d
--- a/js/ui/messageTray.js
1bd53d
+++ b/js/ui/messageTray.js
1bd53d
@@ -1022,17 +1022,20 @@ var MessageTray = GObject.registerClass({
1bd53d
     }
1bd53d
 
1bd53d
     _onNotificationDestroy(notification) {
1bd53d
-        if (this._notification == notification && (this._notificationState == State.SHOWN || this._notificationState == State.SHOWING)) {
1bd53d
-            this._updateNotificationTimeout(0);
1bd53d
-            this._notificationRemoved = true;
1bd53d
-            this._updateState();
1bd53d
-            return;
1bd53d
-        }
1bd53d
+        this._notificationRemoved = this._notification === notification;
1bd53d
 
1bd53d
-        let index = this._notificationQueue.indexOf(notification);
1bd53d
-        if (index != -1) {
1bd53d
-            this._notificationQueue.splice(index, 1);
1bd53d
-            this.emit('queue-changed');
1bd53d
+        if (this._notificationRemoved) {
1bd53d
+            if (this._notificationState === State.SHOWN ||
1bd53d
+                this._notificationState === State.SHOWING) {
1bd53d
+                this._updateNotificationTimeout(0);
1bd53d
+                this._updateState();
1bd53d
+            }
1bd53d
+        } else {
1bd53d
+            const index = this._notificationQueue.indexOf(notification);
1bd53d
+            if (index !== -1) {
1bd53d
+                this._notificationQueue.splice(index, 1);
1bd53d
+                this.emit('queue-changed');
1bd53d
+            }
1bd53d
         }
1bd53d
     }
1bd53d
 
1bd53d
-- 
1bd53d
2.31.1
1bd53d
1bd53d
1bd53d
From 8652836521d0729ce230268c7b448cdb393d5b47 Mon Sep 17 00:00:00 2001
1bd53d
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1bd53d
Date: Thu, 8 Jul 2021 19:23:38 +0200
1bd53d
Subject: [PATCH 4/4] shellInfo: Don't destroy source on undo
1bd53d
1bd53d
Destroying the source from an action callback will result in the
1bd53d
notification being destroyed twice:
1bd53d
1bd53d
 - source.destroy() destroys all its notifications
1bd53d
1bd53d
 - a notification destroys itself after an action
1bd53d
   was activated
1bd53d
1bd53d
This results in unwanted log spam when attempting to dispose the
1bd53d
notification for a second time.
1bd53d
1bd53d
There is actually no good reason for destroying the source explicitly,
1bd53d
as sources already self-destruct with their last notification.
1bd53d
1bd53d
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4457
1bd53d
---
1bd53d
 js/ui/overview.js | 13 +------------
1bd53d
 1 file changed, 1 insertion(+), 12 deletions(-)
1bd53d
1bd53d
diff --git a/js/ui/overview.js b/js/ui/overview.js
1bd53d
index 529779ea8..c71b11389 100644
1bd53d
--- a/js/ui/overview.js
1bd53d
+++ b/js/ui/overview.js
1bd53d
@@ -25,16 +25,6 @@ var OVERVIEW_ACTIVATION_TIMEOUT = 0.5;
1bd53d
 var ShellInfo = class {
1bd53d
     constructor() {
1bd53d
         this._source = null;
1bd53d
-        this._undoCallback = null;
1bd53d
-    }
1bd53d
-
1bd53d
-    _onUndoClicked() {
1bd53d
-        if (this._undoCallback)
1bd53d
-            this._undoCallback();
1bd53d
-        this._undoCallback = null;
1bd53d
-
1bd53d
-        if (this._source)
1bd53d
-            this._source.destroy();
1bd53d
     }
1bd53d
 
1bd53d
     setMessage(text, options) {
1bd53d
@@ -64,9 +54,8 @@ var ShellInfo = class {
1bd53d
             notification.update(text, null, { clear: true });
1bd53d
         }
1bd53d
 
1bd53d
-        this._undoCallback = undoCallback;
1bd53d
         if (undoCallback)
1bd53d
-            notification.addAction(_("Undo"), this._onUndoClicked.bind(this));
1bd53d
+            notification.addAction(_('Undo'), () => undoCallback());
1bd53d
 
1bd53d
         this._source.showNotification(notification);
1bd53d
     }
1bd53d
-- 
1bd53d
2.31.1
1bd53d