gnome-extra/gnome-shell-extensions: Fix drive-menu hiding

Apply upstream fixes to properly hide remote filesystems

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
This commit is contained in:
Pacho Ramos
2021-07-16 10:01:21 +02:00
parent 81d144f27f
commit a8ed912e69
3 changed files with 147 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
From d421bbfa609426032f07f27934eefb214d59012f 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] 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 6c6fd76..f60dab7 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();
--
GitLab

View File

@@ -0,0 +1,32 @@
From 3539ce113907ffda813e1a990891b0911c9702ef 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] 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 3fac236..6c6fd76 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) {
--
GitLab

View File

@@ -0,0 +1,72 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit gnome.org readme.gentoo-r1 meson xdg
DESCRIPTION="JavaScript extensions for GNOME Shell"
HOMEPAGE="https://wiki.gnome.org/Projects/GnomeShell/Extensions"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"
DEPEND="
>=dev-libs/glib-2.26:2
>=gnome-base/libgtop-2.28.3[introspection]
>=app-eselect/eselect-gnome-shell-extensions-20111211
"
RDEPEND="${DEPEND}
>=dev-libs/gjs-1.29
dev-libs/gobject-introspection:=
dev-libs/atk[introspection]
gnome-base/gnome-menus:3[introspection]
=gnome-base/gnome-shell-$(ver_cut 1-2)*
media-libs/clutter:1.0[introspection]
net-libs/telepathy-glib[introspection]
x11-libs/gdk-pixbuf:2[introspection]
x11-libs/gtk+:3[introspection]
x11-libs/pango[introspection]
x11-themes/adwaita-icon-theme
>=x11-wm/mutter-3.32[introspection]
"
BDEPEND="
>=sys-devel/gettext-0.19.8
virtual/pkgconfig
"
DISABLE_AUTOFORMATTING="yes"
DOC_CONTENTS="Installed extensions installed are initially disabled by default.
To change the system default and enable some extensions, you can use
# eselect gnome-shell-extensions
Alternatively, to enable/disable extensions on a per-user basis,
you can use the https://extensions.gnome.org/ web interface, the
gnome-extra/gnome-tweaks GUI, or modify the org.gnome.shell
enabled-extensions gsettings key from the command line or a script."
PATCHES=(
"${FILESDIR}/${PV}-drive-menu-indicator-visibility.patch"
"${FILESDIR}/${PV}-drive-menu-hide-items.patch"
)
src_configure() {
meson_src_configure \
-Dextension_set=all \
-Dclassic_mode=true
}
src_install() {
meson_src_install
readme.gentoo_create_doc
}
pkg_postinst() {
xdg_pkg_postinst
ebegin "Updating list of installed extensions"
eselect gnome-shell-extensions update
eend $?
readme.gentoo_print_elog
}