gnome-shell-extensions/backport-drive-menu-fix.patch
Florian Müllner d79825e0b3 Update to 40.3
Resolves: #1983551
2021-07-19 16:46:36 +02:00

77 lines
2.8 KiB
Diff

From cc021589b848077811b592bbe2d23a60525a85bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 13 Jul 2021 11:40:31 +0200
Subject: [PATCH 1/2] drive-menu: Fix indicator visibility
Commit 519269be9d made the check for network mounts non-blocking, and
we now update the indicator's visibility before a newly-added network
mount is hidden.
Address this by monitoring the item itself for visibility changes.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176>
---
extensions/drive-menu/extension.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index 3fac2360..6c6fd763 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -189,6 +189,8 @@ class DriveMenu extends PanelMenu.Button {
let item = new MountMenuItem(mount);
this._mounts.unshift(item);
this.menu.addMenuItem(item, 0);
+
+ item.connect('notify::visible', () => this._updateMenuVisibility());
}
_removeMount(mount) {
--
2.31.1
From 15c83db79379532b72df1989463fc102a90fdfc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 13 Jul 2021 11:54:21 +0200
Subject: [PATCH 2/2] drive-menu: Hide items initially
Now that the check for network mounts is non-blocking, the initial
sync doesn't take effect immediately. We don't want hidden items
to briefly flash the indicator, so create them initially hidden.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176>
---
extensions/drive-menu/extension.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index 6c6fd763..f60dab75 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -41,6 +41,8 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
ejectButton.connect('clicked', this._eject.bind(this));
this.add(ejectButton);
+ this.hide();
+
this._changedId = mount.connect('changed', this._syncVisibility.bind(this));
this._syncVisibility();
}
@@ -155,10 +157,8 @@ class DriveMenu extends PanelMenu.Button {
this.add_child(icon);
this._monitor = Gio.VolumeMonitor.get();
- this._addedId = this._monitor.connect('mount-added', (monitor, mount) => {
- this._addMount(mount);
- this._updateMenuVisibility();
- });
+ this._addedId = this._monitor.connect('mount-added',
+ (monitor, mount) => this._addMount(mount));
this._removedId = this._monitor.connect('mount-removed', (monitor, mount) => {
this._removeMount(mount);
this._updateMenuVisibility();
--
2.31.1