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