diff --git a/_service b/_service deleted file mode 100644 index 4d969a3..0000000 --- a/_service +++ /dev/null @@ -1,16 +0,0 @@ - - - https://gitlab.gnome.org/World/ShellExtensions/desktop-icons.git - git - 20.04.0 - @PARENT_TAG@ - enable - suse - - - - *.tar - xz - - - diff --git a/_servicedata b/_servicedata deleted file mode 100644 index aca892e..0000000 --- a/_servicedata +++ /dev/null @@ -1,4 +0,0 @@ - - - https://gitlab.gnome.org/World/ShellExtensions/desktop-icons.git - ea1f903edb76eec7c23e1f2ea5cf82a956d3e0ef \ No newline at end of file diff --git a/desktop-icon-gnome-40.patch b/desktop-icon-gnome-40.patch new file mode 100644 index 0000000..89dacc1 --- /dev/null +++ b/desktop-icon-gnome-40.patch @@ -0,0 +1,12 @@ +Index: desktop-icons-20.10.0/metadata.json +=================================================================== +--- desktop-icons-20.10.0.orig/metadata.json ++++ desktop-icons-20.10.0/metadata.json +@@ -2,6 +2,6 @@ + "name": "Desktop Icons", + "description": "Add icons to the desktop", + "uuid": "desktop-icons@csoriano", +- "shell-version": ["3.38.0"], ++ "shell-version": ["3.38.0", "40"], + "url": "https://gitlab.gnome.org/World/ShellExtensions/desktop-icons" + } diff --git a/desktop-icons-20.04.0.obscpio b/desktop-icons-20.04.0.obscpio deleted file mode 100644 index 04c4071..0000000 --- a/desktop-icons-20.04.0.obscpio +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aa4fe82449e3f671e4f2aab4e78acff9e97138d2e4763ef34212ec9ad257e7f3 -size 277003 diff --git a/desktop-icons-20.10.0.tar.xz b/desktop-icons-20.10.0.tar.xz new file mode 100644 index 0000000..e9b846e --- /dev/null +++ b/desktop-icons-20.10.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa5f4166e8863d1566b20852602af8e8cfeb0b7ae4164b0431588509e4776a01 +size 58484 diff --git a/desktop-icons.obsinfo b/desktop-icons.obsinfo deleted file mode 100644 index 533c3d3..0000000 --- a/desktop-icons.obsinfo +++ /dev/null @@ -1,5 +0,0 @@ -name: desktop-icons -version: 20.04.0 -mtime: 1585939561 -commit: ea1f903edb76eec7c23e1f2ea5cf82a956d3e0ef - diff --git a/gnome-shell-extension-desktop-icons-add-mount-disk-icon.patch b/gnome-shell-extension-desktop-icons-add-mount-disk-icon.patch deleted file mode 100644 index ce063c7..0000000 --- a/gnome-shell-extension-desktop-icons-add-mount-disk-icon.patch +++ /dev/null @@ -1,237 +0,0 @@ -From 595ffd86b97902fdc4b1738b80b2a889be902965 Mon Sep 17 00:00:00 2001 -From: Xiaoguang Wang -Date: Sun, 26 Apr 2020 11:51:50 +0800 -Subject: [PATCH] general: Add showing mounted devices's icon - -https://gitlab.gnome.org/World/ShellExtensions/desktop-icons/-/issues/36 ---- - desktopIconsUtil.js | 41 ++++++++++++++++ - desktopManager.js | 48 ++++++++++++++++++- - fileItem.js | 15 ++++++ - prefs.js | 2 + - ...shell.extensions.desktop-icons.gschema.xml | 5 ++ - 5 files changed, 110 insertions(+), 1 deletion(-) - -diff --git a/desktopIconsUtil.js b/desktopIconsUtil.js -index 0aea654..696c945 100644 ---- a/desktopIconsUtil.js -+++ b/desktopIconsUtil.js -@@ -22,6 +22,8 @@ const GLib = imports.gi.GLib; - const ExtensionUtils = imports.misc.extensionUtils; - const Me = ExtensionUtils.getCurrentExtension(); - const Prefs = Me.imports.prefs; -+const Main = imports.ui.main; -+const ShellMountOperation = imports.ui.shellMountOperation; - - const TERMINAL_SCHEMA = 'org.gnome.desktop.default-applications.terminal'; - const EXEC_KEY = 'exec'; -@@ -121,3 +123,42 @@ function getGtkClassBackgroundColor(classname, state) { - context.add_class(classname); - return context.get_background_color(state); - } -+ -+// Reference the extension org.gnome.shell.extensions.drive-menu -+function eject(mount) { -+ let unmountArgs = [ -+ Gio.MountUnmountFlags.NONE, -+ (new ShellMountOperation.ShellMountOperation(mount)).mountOp, -+ null, // Gio.Cancellable -+ ]; -+ -+ if (mount.can_eject()) { -+ mount.eject_with_operation(...unmountArgs, -+ _ejectFinish.bind(mount)); -+ } else { -+ mount.unmount_with_operation(...unmountArgs, -+ _unmountFinish.bind(mount)); -+ } -+} -+ -+function _unmountFinish(mount, result) { -+ try { -+ mount.unmount_with_operation_finish(result); -+ } catch (e) { -+ this._reportFailure(e); -+ } -+} -+ -+function _ejectFinish(mount, result) { -+ try { -+ mount.eject_with_operation_finish(result); -+ } catch (e) { -+ this._reportFailure(e); -+ } -+} -+ -+function _reportFailure(exception) { -+ // TRANSLATORS: %s is the filesystem name -+ let msg = _('Ejecting drive “%s” failed:').format(this.mount.get_name()); -+ Main.notifyError(msg, exception.message); -+} -diff --git a/desktopManager.js b/desktopManager.js -index 9d81a77..4e1abe9 100644 ---- a/desktopManager.js -+++ b/desktopManager.js -@@ -86,6 +86,12 @@ var DesktopManager = GObject.registerClass({ - Main.layoutManager._backgroundGroup.add_child(this._rubberBand); - this._grabHelper = new GrabHelper.GrabHelper(global.stage); - -+ this._mountMonitor = Gio.VolumeMonitor.get(); -+ this._mountAddedId = this._mountMonitor.connect('mount-added', (monitor, mount) => { -+ this._recreateDesktopIcons(); }); -+ this._mountRemovedId = this._mountMonitor.connect('mount-removed', (monitor, mount) => { -+ this._recreateDesktopIcons(); }); -+ - this._addDesktopIcons(); - this._monitorDesktopFolder(); - -@@ -238,8 +244,14 @@ var DesktopManager = GObject.registerClass({ - } - - try { -+ let items = []; -+ for (let item of await this._enumerateDesktop()) -+ items.push(item); -+ for (let item of this._getMounts()) -+ items.push(item); -+ - let tmpFileItems = new Map(); -- for (let [file, info, extra] of await this._enumerateDesktop()) { -+ for (let [file, info, extra] of items) { - let fileItem = new FileItem.FileItem(file, info, extra); - tmpFileItems.set(fileItem.file.get_uri(), fileItem); - let fileItemHandler = {} -@@ -311,6 +323,33 @@ var DesktopManager = GObject.registerClass({ - this._monitorDesktopDir.connect('changed', (obj, file, otherFile, eventType) => this._updateDesktopIfChanged(file, otherFile, eventType)); - } - -+ _getMounts() { -+ let files = []; -+ if (!Prefs.settings.get_boolean('show-mount')) -+ return files; -+ -+ this._mountMonitor.get_mounts().forEach( mount => { -+ if (this._isNetworkMount(mount)) -+ return; -+ -+ let file = mount.get_root(); -+ let info = file.query_info(DesktopIconsUtil.DEFAULT_ATTRIBUTES, -+ Gio.FileQueryInfoFlags.NONE, -+ null); -+ files.push([file, info, Prefs.FileType.MOUNT_DISK]); -+ }); -+ -+ return files; -+ } -+ -+ _isNetworkMount(mount) { -+ let volume = mount.get_volume(); -+ if (!volume) -+ return true; -+ -+ return volume.get_identifier('class') == 'network'; -+ } -+ - checkIfSpecialFilesAreSelected() { - for (let fileItem of this._selection) { - if (fileItem.isSpecial) -@@ -723,6 +762,13 @@ var DesktopManager = GObject.registerClass({ - this._monitorDesktopDir.cancel(); - this._monitorDesktopDir = null; - -+ if (this._mountAddedId) -+ this._mountMonitor.disconnect(this._mountAddedId); -+ this._mountAddedId = 0; -+ if (this._mountRemovedId) -+ this._mountMonitor.disconnect(this._mountRemovedId); -+ this._mountRemovedId = 0; -+ - if (this.settingsId) - Prefs.settings.disconnect(this.settingsId); - this.settingsId = 0; -diff --git a/fileItem.js b/fileItem.js -index 8397bb2..2e2a56d 100644 ---- a/fileItem.js -+++ b/fileItem.js -@@ -77,6 +77,9 @@ var FileItem = GObject.registerClass({ - this._isSpecial = this._fileExtra != Prefs.FileType.NONE; - - this._file = file; -+ this._mount = null; -+ if (this._fileExtra == Prefs.FileType.MOUNT_DISK) -+ this._mount = this._file.find_enclosing_mount(null); - - this._savedCoordinates = null; - let savedCoordinates = fileInfo.get_attribute_as_string('metadata::nautilus-icon-position'); -@@ -291,6 +294,10 @@ var FileItem = GObject.registerClass({ - this._icon.child = this._createEmblemedStIcon(this._fileInfo.get_icon(), null); - return; - } -+ if (this._fileExtra == Prefs.FileType.MOUNT_DISK) { -+ this._icon.child = this._createEmblemedStIcon(this._mount.get_icon(), null); -+ return; -+ } - - let thumbnailFactory = GnomeDesktop.DesktopThumbnailFactory.new(GnomeDesktop.DesktopThumbnailSize.LARGE); - if ((Prefs.nautilusSettings.get_string('show-image-thumbnails') != 'never') && -@@ -516,6 +523,10 @@ var FileItem = GObject.registerClass({ - Extension.desktopManager.doEmptyTrash(); - } - -+ _onEjectClicked() { -+ DesktopIconsUtil.eject(this._mount); -+ } -+ - get _allowLaunchingText() { - if (this.trustedDesktopFile) - return _("Don’t Allow Launching"); -@@ -640,6 +651,10 @@ var FileItem = GObject.registerClass({ - this._menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this._menu.addAction(_('Empty Trash'), () => this._onEmptyTrashClicked()); - break; -+ case Prefs.FileType.MOUNT_DISK: -+ this._menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); -+ this._menu.addAction(_('Eject'), () => this._onEjectClicked()); -+ break; - default: - break; - } -diff --git a/prefs.js b/prefs.js -index 66382f7..4b33e55 100644 ---- a/prefs.js -+++ b/prefs.js -@@ -40,6 +40,7 @@ var FileType = { - NONE: null, - USER_DIRECTORY_HOME: 'show-home', - USER_DIRECTORY_TRASH: 'show-trash', -+ MOUNT_DISK: 'mount-disk', - } - - var nautilusSettings; -@@ -102,6 +103,7 @@ function buildPrefsWidget() { - frame.add(buildSelector('icon-size', _("Size for the desktop icons"), { 'small': _("Small"), 'standard': _("Standard"), 'large': _("Large") })); - frame.add(buildSwitcher('show-home', _("Show the personal folder in the desktop"))); - frame.add(buildSwitcher('show-trash', _("Show the trash icon in the desktop"))); -+ frame.add(buildSwitcher('show-mount', _("Show mounted drives in the desktop"))); - frame.show_all(); - return frame; - } -diff --git a/schemas/org.gnome.shell.extensions.desktop-icons.gschema.xml b/schemas/org.gnome.shell.extensions.desktop-icons.gschema.xml -index bb4e50f..de126b5 100644 ---- a/schemas/org.gnome.shell.extensions.desktop-icons.gschema.xml -+++ b/schemas/org.gnome.shell.extensions.desktop-icons.gschema.xml -@@ -20,6 +20,11 @@ - true - Show trash icon - Show the trash icon in the desktop. -+ -+ -+ true -+ Show mounted drives -+ Show mounted drives in the desktop. - - - --- -2.26.0 - diff --git a/gnome-shell-extension-desktop-icons.changes b/gnome-shell-extension-desktop-icons.changes index 2e64ffc..224ff2b 100644 --- a/gnome-shell-extension-desktop-icons.changes +++ b/gnome-shell-extension-desktop-icons.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Fri Mar 19 19:05:48 UTC 2021 - Dominique Leuenberger + +- Add desktop-icon-gnome-40.patch: Declare compatible to GNOME 40. + +------------------------------------------------------------------- +Thu Mar 18 01:55:54 UTC 2021 - Xiaoguang Wang + +- Update to version 20.10.0: + * Support for Gnome Shell 3.38 and new dialog APIs. + * Fix dragging several files. + * Allocate draggable actor before starting the drag. + * Fix for the native switcheroo controller. + * Avoid scheduling multiple layoutChildren idlers and other + fixes. + * Templates support. + * Preview files with spacebar. + * Allow to launch programs with the discrete GPU. + * Show mounted devices. + * Set home folder label to localized "Home". +- Drop + gnome-shell-extension-desktop-icons-add-mount-disk-icon.patch: + Fixed upstream. + ------------------------------------------------------------------- Mon Apr 27 02:56:44 UTC 2020 - Xiaoguang Wang diff --git a/gnome-shell-extension-desktop-icons.spec b/gnome-shell-extension-desktop-icons.spec index 4b2fdb3..208c414 100644 --- a/gnome-shell-extension-desktop-icons.spec +++ b/gnome-shell-extension-desktop-icons.spec @@ -1,7 +1,7 @@ # # spec file for package gnome-shell-extension-desktop-icons # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,13 +17,15 @@ Name: gnome-shell-extension-desktop-icons -Version: 20.04.0 +Version: 20.10.0 Release: 0 Summary: Desktop icon support for GNOME Shell License: GPL-3.0-or-later Group: System/GUI/GNOME URL: https://gitlab.gnome.org/World/ShellExtensions/desktop-icons -Source: desktop-icons-%{version}.tar.xz +Source: https://gitlab.gnome.org/World/ShellExtensions/desktop-icons/uploads/5e2d0748cf79d255d7c23df6a6e6901b/desktop-icons-%{version}.tar.xz +# PATCH-FIX-UPSTREAM desktop-icon-gnome-40.patch dimstar@opensuse.org -- Make extension compatible with GNOME 40 +Patch0: desktop-icon-gnome-40.patch BuildRequires: gnome-patch-translation # Needed for directory ownership BuildRequires: gnome-shell >= 3.30 @@ -36,9 +38,6 @@ Requires: nautilus >= 3.30.4 Requires: xdg-desktop-portal-gtk BuildArch: noarch -# PATCH-FIX-UPSTREAM gnome-shell-extension-desktop-icons-add-mount-disk-icon.patch jsc#SLE-12572 glgo#GNOME/World/ShellExtensions/desktop-icons!171 xwang@suse.com -- Add showing mounted devices's icon -Patch0: gnome-shell-extension-desktop-icons-add-mount-disk-icon.patch - %description This package provides a GNOME Shell extension for showing the contents of ~/Desktop on the desktop of the Shell. Common file management @@ -46,8 +45,7 @@ operations such as launching, copy/paste, rename and deleting are supported. %prep -%setup -q -n desktop-icons-%{version} -%patch0 -p1 +%autosetup -n desktop-icons-%{version} translation-update-upstream po %{name} gnome-patch-translation-prepare po %{name}