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

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