From 8d8fc5f34a70d81ac9fd1747a96a6435f1cd3276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 7 Jan 2025 19:27:49 +0100 Subject: [PATCH] Fix '%k' macros in .desktop files Resolves: https://issues.redhat.com/browse/RHEL-72966 --- ...esktop-icons-Fix-k-in-.desktop-files.patch | 42 +++++++++++++++++++ gnome-shell-extensions.spec | 7 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-desktop-icons-Fix-k-in-.desktop-files.patch diff --git a/0001-desktop-icons-Fix-k-in-.desktop-files.patch b/0001-desktop-icons-Fix-k-in-.desktop-files.patch new file mode 100644 index 0000000..7ce83c0 --- /dev/null +++ b/0001-desktop-icons-Fix-k-in-.desktop-files.patch @@ -0,0 +1,42 @@ +From f65b9f2df5bf913f8c152ea770795d2cdcb14c6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Tue, 7 Jan 2025 19:09:01 +0100 +Subject: [PATCH] desktop-icons: Fix '%k' in .desktop files + +In order to support Link-type .desktop files, we load the file +ourselves, and then create the AppInfo from the loaded keyfile +to avoid reading the file twice. + +Unfortunately that means that the AppInfo loses the filename +information, which is necessary to substitute the '%k' macro. + +In order to support both the macro and Link-type .desktop files, +we have to take the hit and let GIO read the file again. +--- + extensions/desktop-icons/fileItem.js | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/extensions/desktop-icons/fileItem.js b/extensions/desktop-icons/fileItem.js +index 1c9a1e55..c765967b 100644 +--- a/extensions/desktop-icons/fileItem.js ++++ b/extensions/desktop-icons/fileItem.js +@@ -241,13 +241,14 @@ var FileItem = class { + if (this._isDesktopFile) { + try { + const keyFile = new GLib.KeyFile(); +- keyFile.load_from_file(this._file.get_path(), GLib.KeyFileFlags.NONE); ++ const path = this._file.get_path(); ++ keyFile.load_from_file(path, GLib.KeyFileFlags.NONE); + + const type = keyFile.get_string( + GLib.KEY_FILE_DESKTOP_GROUP, GLib.KEY_FILE_DESKTOP_KEY_TYPE); + switch (type) { + case GLib.KEY_FILE_DESKTOP_TYPE_APPLICATION: +- this._desktopFile = Gio.DesktopAppInfo.new_from_keyfile(keyFile); ++ this._desktopFile = Gio.DesktopAppInfo.new_from_filename(path); + if (!this._desktopFile) { + log(`Couldn’t parse ${this._displayName} as a desktop file, will treat it as a regular file.`); + this._isValidDesktopFile = false; +-- +2.47.1 + diff --git a/gnome-shell-extensions.spec b/gnome-shell-extensions.spec index 25f58d5..3b8f5e1 100644 --- a/gnome-shell-extensions.spec +++ b/gnome-shell-extensions.spec @@ -6,7 +6,7 @@ Name: gnome-shell-extensions Version: 3.32.1 -Release: 39%{?dist} +Release: 40%{?dist} Summary: Modify and extend GNOME Shell functionality and behavior Group: User Interface/Desktops @@ -59,6 +59,7 @@ Patch0030: 0001-desktop-icons-Don-t-use-blocking-IO.patch Patch0031: 0001-panel-favorites-Update-to-upstream-version.patch Patch0032: 0001-desktop-icons-Don-t-try-spawn-with-non-existent-work.patch Patch0033: 0001-classification-banner-Hide-from-picks.patch +Patch0034: 0001-desktop-icons-Fix-k-in-.desktop-files.patch %description GNOME Shell Extensions is a collection of extensions providing additional and @@ -573,6 +574,10 @@ cp $RPM_SOURCE_DIR/gnome-classic.desktop $RPM_BUILD_ROOT%{_datadir}/xsessions %changelog +* Tue Jan 07 2025 Florian Müllner - 3.32.1-40 +- Fix '%k' macro in .desktop files + Resolves: RHEL-72966 + * Tue Apr 23 2024 Florian Müllner - 3.32.1-39 - Fix tooltip animation times Resolves: RHEL-33681