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

28ed8f
From 43d6305bfbe079a3bf80a96d40a3a176c165ef7a Mon Sep 17 00:00:00 2001
28ed8f
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
28ed8f
Date: Thu, 23 May 2019 06:12:56 +0200
28ed8f
Subject: [PATCH 1/5] realmd: Set login format to null on start and update if
28ed8f
 invalid
28ed8f
28ed8f
We were checking an undefined property but that would lead to a a warning.
28ed8f
Instead we can consider the login format unset until is null, and in case
28ed8f
update it.
28ed8f
28ed8f
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/700
28ed8f
---
28ed8f
 js/gdm/realmd.js | 3 ++-
28ed8f
 1 file changed, 2 insertions(+), 1 deletion(-)
28ed8f
28ed8f
diff --git a/js/gdm/realmd.js b/js/gdm/realmd.js
28ed8f
index 50f3c5899..04cd99787 100644
28ed8f
--- a/js/gdm/realmd.js
28ed8f
+++ b/js/gdm/realmd.js
28ed8f
@@ -21,6 +21,7 @@ var Manager = class {
28ed8f
                                            '/org/freedesktop/realmd',
28ed8f
                                            this._reloadRealms.bind(this))
28ed8f
         this._realms = {};
28ed8f
+        this._loginFormat = null;
28ed8f
 
28ed8f
         this._signalId = this._aggregateProvider.connect('g-properties-changed',
28ed8f
             (proxy, properties) => {
28ed8f
@@ -86,7 +87,7 @@ var Manager = class {
28ed8f
     }
28ed8f
 
28ed8f
     get loginFormat() {
28ed8f
-        if (this._loginFormat !== undefined)
28ed8f
+        if (this._loginFormat)
28ed8f
             return this._loginFormat;
28ed8f
 
28ed8f
         this._updateLoginFormat();
28ed8f
-- 
28ed8f
2.21.1
28ed8f
28ed8f
28ed8f
From 80836cd1ea4ef5d69a35bdfd7931b0e2c202f5b3 Mon Sep 17 00:00:00 2001
28ed8f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
28ed8f
Date: Tue, 9 Jun 2020 19:42:21 +0200
28ed8f
Subject: [PATCH 2/5] popupMenu: Guard against non-menu-item children
28ed8f
28ed8f
This avoid a harmless but annoying warning.
28ed8f
---
28ed8f
 js/ui/popupMenu.js | 3 ++-
28ed8f
 1 file changed, 2 insertions(+), 1 deletion(-)
28ed8f
28ed8f
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
28ed8f
index 44818533a..b5115d7f7 100644
28ed8f
--- a/js/ui/popupMenu.js
28ed8f
+++ b/js/ui/popupMenu.js
28ed8f
@@ -696,7 +696,8 @@ var PopupMenuBase = class {
28ed8f
     }
28ed8f
 
28ed8f
     _getMenuItems() {
28ed8f
-        return this.box.get_children().map(a => a._delegate).filter(item => {
28ed8f
+        const children = this.box.get_children().filter(a => a._delegate !== undefined);
28ed8f
+        return children.map(a => a._delegate).filter(item => {
28ed8f
             return item instanceof PopupBaseMenuItem || item instanceof PopupMenuSection;
28ed8f
         });
28ed8f
     }
28ed8f
-- 
28ed8f
2.21.1
28ed8f
28ed8f
28ed8f
From f0af67381cf0fb9a9ab766fa6b3d3e6ff5707122 Mon Sep 17 00:00:00 2001
28ed8f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
28ed8f
Date: Tue, 9 Jun 2020 19:48:06 +0200
28ed8f
Subject: [PATCH 3/5] st/shadow: Check pipeline when painting
28ed8f
28ed8f
We shouldn't simply assume that st_shadow_helper_update() has been
28ed8f
called before paint() or that the pipeline was created successfully.
28ed8f
---
28ed8f
 src/st/st-shadow.c | 11 ++++++-----
28ed8f
 1 file changed, 6 insertions(+), 5 deletions(-)
28ed8f
28ed8f
diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c
28ed8f
index f3a22f034..7665de755 100644
28ed8f
--- a/src/st/st-shadow.c
28ed8f
+++ b/src/st/st-shadow.c
28ed8f
@@ -289,9 +289,10 @@ st_shadow_helper_paint (StShadowHelper  *helper,
28ed8f
                         ClutterActorBox *actor_box,
28ed8f
                         guint8           paint_opacity)
28ed8f
 {
28ed8f
-  _st_paint_shadow_with_opacity (helper->shadow,
28ed8f
-                                 framebuffer,
28ed8f
-                                 helper->pipeline,
28ed8f
-                                 actor_box,
28ed8f
-                                 paint_opacity);
28ed8f
+  if (helper->pipeline != NULL)
28ed8f
+    _st_paint_shadow_with_opacity (helper->shadow,
28ed8f
+                                   framebuffer,
28ed8f
+                                   helper->pipeline,
28ed8f
+                                   actor_box,
28ed8f
+                                   paint_opacity);
28ed8f
 }
28ed8f
-- 
28ed8f
2.21.1
28ed8f
28ed8f
28ed8f
From a500f3c59a485755b8361e8f4dd48f8df4af95ba Mon Sep 17 00:00:00 2001
28ed8f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
28ed8f
Date: Tue, 5 Jan 2021 21:42:24 +0100
28ed8f
Subject: [PATCH 4/5] viewSelector: Don't set page parent during construction
28ed8f
28ed8f
gjs now aggressively garbage-collects objects that fall out of scope,
28ed8f
sometimes too aggressively:
28ed8f
28ed8f
 - we pass a child as construct property to StBin
28ed8f
 - as a result, the child's ::parent-set handler runs
28ed8f
 - when calling clutter_actor_get_parent() from that
28ed8f
   handler, the returned object is garbage-collected
28ed8f
   *before* the constructor returns (and thus the
28ed8f
   assignment that would keep it alive)
28ed8f
28ed8f
This is a bug on the gjs side that should be fixed, but we can easily
28ed8f
work around the issue by setting the child after constructing the
28ed8f
parent.
28ed8f
---
28ed8f
 js/ui/viewSelector.js | 12 +++++++-----
28ed8f
 1 file changed, 7 insertions(+), 5 deletions(-)
28ed8f
28ed8f
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
28ed8f
index 77146552d..6529ac9a5 100644
28ed8f
--- a/js/ui/viewSelector.js
28ed8f
+++ b/js/ui/viewSelector.js
28ed8f
@@ -301,11 +301,13 @@ var ViewSelector = class {
28ed8f
     _addPage(actor, name, a11yIcon, params) {
28ed8f
         params = Params.parse(params, { a11yFocus: null });
28ed8f
 
28ed8f
-        let page = new St.Bin({ child: actor,
28ed8f
-                                x_align: St.Align.START,
28ed8f
-                                y_align: St.Align.START,
28ed8f
-                                x_fill: true,
28ed8f
-                                y_fill: true });
28ed8f
+        let page = new St.Bin({
28ed8f
+            x_align: St.Align.START,
28ed8f
+            y_align: St.Align.START,
28ed8f
+            x_fill: true,
28ed8f
+            y_fill: true,
28ed8f
+        });
28ed8f
+        page.set_child(actor);
28ed8f
         if (params.a11yFocus)
28ed8f
             Main.ctrlAltTabManager.addGroup(params.a11yFocus, name, a11yIcon);
28ed8f
         else
28ed8f
-- 
28ed8f
2.21.1
28ed8f
28ed8f
28ed8f
From a53d1a74fed3aee896a6930130bd7e3a39a24255 Mon Sep 17 00:00:00 2001
28ed8f
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
28ed8f
Date: Fri, 23 Oct 2020 23:44:48 +0200
28ed8f
Subject: [PATCH 5/5] workspacesView: Don't set up MetaLater when unparented
28ed8f
28ed8f
We already do the check in the later handler, but if we got
28ed8f
unparented because the actor is destroyed, then the call to
28ed8f
get_parent() itself will trigger a (harmless but annoying)
28ed8f
warning.
28ed8f
---
28ed8f
 js/ui/workspacesView.js | 3 +++
28ed8f
 1 file changed, 3 insertions(+)
28ed8f
28ed8f
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
28ed8f
index e302296a6..3270900b2 100644
28ed8f
--- a/js/ui/workspacesView.js
28ed8f
+++ b/js/ui/workspacesView.js
28ed8f
@@ -715,6 +715,9 @@ var WorkspacesDisplay = class {
28ed8f
             oldParent.disconnect(this._notifyOpacityId);
28ed8f
         this._notifyOpacityId = 0;
28ed8f
 
28ed8f
+        if (!this.actor.get_parent())
28ed8f
+            return;
28ed8f
+
28ed8f
         Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
28ed8f
             let newParent = this.actor.get_parent();
28ed8f
             if (!newParent)
28ed8f
-- 
28ed8f
2.21.1
28ed8f