gnome-shell-extensions/desktop-icons-Make-resilient-to-background-reloads.patch
2022-12-16 22:56:54 +01:00

53 lines
2.1 KiB
Diff

From 5c3737cd0c5a9e60064246d3ae4a8811e617be89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Fri, 16 Dec 2022 22:30:35 +0100
Subject: [PATCH] New try
---
extensions/desktop-icons/desktopManager.js | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/extensions/desktop-icons/desktopManager.js b/extensions/desktop-icons/desktopManager.js
index 08bc82b7..d2713b6b 100644
--- a/extensions/desktop-icons/desktopManager.js
+++ b/extensions/desktop-icons/desktopManager.js
@@ -83,7 +83,6 @@ var DesktopManager = GObject.registerClass({
this._discreteGpuAvailable = false;
this._rubberBandActive = false;
- this._monitorsChangedId = Main.layoutManager.connect('monitors-changed', () => this._recreateDesktopIcons());
this._rubberBand = new St.Widget({ style_class: 'rubber-band' });
this._rubberBand.hide();
Main.layoutManager._backgroundGroup.add_child(this._rubberBand);
@@ -109,6 +108,13 @@ var DesktopManager = GObject.registerClass({
return origCapturedEvent.bind(this._grabHelper)(event);
};
+ this._origUpdateBackgrounds =
+ Main.layoutManager.prototype._updateBackgrounds;
+ Main.layoutManager.prototype._updateBackgrounds = () => {
+ this._origUpdateBackgrounds.call(Main.layoutManager);
+ this._recreateDesktopIcons();
+ };
+
this._addDesktopIcons();
this._monitorDesktopFolder();
@@ -843,9 +849,10 @@ var DesktopManager = GObject.registerClass({
GLib.source_remove(this._deleteChildrenId);
this._deleteChildrenId = 0;
- if (this._monitorsChangedId)
- Main.layoutManager.disconnect(this._monitorsChangedId);
- this._monitorsChangedId = 0;
+ if (this._origUpdateBackgrounds)
+ Main.layoutManager.prototype._updateBackgrounds = this._origUpdateBackgrounds;
+ delete this._origUpdateBackgrounds;
+
if (this._stageReleaseEventId)
global.stage.disconnect(this._stageReleaseEventId);
this._stageReleaseEventId = 0;
--
2.38.1