diff --git a/fix-inhibit-shortcut-permission.patch b/fix-inhibit-shortcut-permission.patch new file mode 100644 index 0000000..d20d91b --- /dev/null +++ b/fix-inhibit-shortcut-permission.patch @@ -0,0 +1,107 @@ +From 3a89e8597f6f3e7fa468bae93768f8253a3141e7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Thu, 6 Oct 2022 14:30:20 +0200 +Subject: [PATCH 1/2] inhibitShortcutsDialog: Don't override resource + +PermissionStore's Set() method takes a complete permission +table, so when setting an app's permission, we are implicitly +removing all previously set entries for other apps. + +Switch to the SetPermission() method which sets the permission +for a single app. + +https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5937 + +Part-of: + +--- + ...g.freedesktop.impl.portal.PermissionStore.xml | 7 +++++++ + js/ui/inhibitShortcutsDialog.js | 16 ++++++---------- + 2 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/data/dbus-interfaces/org.freedesktop.impl.portal.PermissionStore.xml b/data/dbus-interfaces/org.freedesktop.impl.portal.PermissionStore.xml +index 75fbc468a8..55d3fc30cb 100644 +--- a/data/dbus-interfaces/org.freedesktop.impl.portal.PermissionStore.xml ++++ b/data/dbus-interfaces/org.freedesktop.impl.portal.PermissionStore.xml +@@ -13,6 +13,13 @@ + + + ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/js/ui/inhibitShortcutsDialog.js b/js/ui/inhibitShortcutsDialog.js +index c59544eaf9..8ef5861261 100644 +--- a/js/ui/inhibitShortcutsDialog.js ++++ b/js/ui/inhibitShortcutsDialog.js +@@ -1,5 +1,5 @@ + /* exported InhibitShortcutsDialog */ +-const { Clutter, Gio, GLib, GObject, Gtk, Meta, Pango, Shell, St } = imports.gi; ++const {Clutter, Gio, GObject, Gtk, Meta, Pango, Shell, St} = imports.gi; + + const Dialog = imports.ui.dialog; + const ModalDialog = imports.ui.modalDialog; +@@ -57,15 +57,11 @@ var InhibitShortcutsDialog = GObject.registerClass({ + if (!this._shouldUsePermStore() || this._permStore == null) + return; + +- let permissions = {}; +- permissions[this._app.get_id()] = [grant]; +- let data = GLib.Variant.new('av', {}); +- +- this._permStore.SetRemote(APP_PERMISSIONS_TABLE, +- true, +- APP_PERMISSIONS_ID, +- permissions, +- data, ++ this._permStore.SetPermissionRemote(APP_PERMISSIONS_TABLE, ++ true, ++ APP_PERMISSIONS_ID, ++ this._app.get_id(), ++ [grant], + (result, error) => { + if (error != null) + log(error.message); +-- +2.43.0 + + +From 1391efb2356d1b1eac631df2f5fbd61a7a72bf52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Fri, 18 Nov 2022 22:40:31 +0100 +Subject: [PATCH 2/2] inhibitShorcutsDialog: Fix permission check + +Each permission entry is an array of strings, so checking that against +the expected string itself will always fail. + +https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6107 + +Part-of: + +--- + js/ui/inhibitShortcutsDialog.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/js/ui/inhibitShortcutsDialog.js b/js/ui/inhibitShortcutsDialog.js +index 8ef5861261..4cd2793c3d 100644 +--- a/js/ui/inhibitShortcutsDialog.js ++++ b/js/ui/inhibitShortcutsDialog.js +@@ -145,7 +145,7 @@ var InhibitShortcutsDialog = GObject.registerClass({ + let [permissions] = res; + if (permissions[appId] === undefined) // Not found + this._dialog.open(); +- else if (permissions[appId] == GRANTED) ++ else if (permissions[appId][0] === GRANTED) + this._emitResponse(DialogResponse.ALLOW); + else + this._emitResponse(DialogResponse.DENY); +-- +2.43.0 + diff --git a/gnome-shell.spec b/gnome-shell.spec index 72dc1b4..6a3a266 100644 --- a/gnome-shell.spec +++ b/gnome-shell.spec @@ -2,7 +2,7 @@ Name: gnome-shell Version: 40.10 -Release: 19%{?dist} +Release: 20%{?dist} Summary: Window management and application launching for GNOME License: GPLv2+ @@ -62,6 +62,7 @@ Patch58: optional-portal-helper.patch Patch59: 0001-extensionSystem-Support-locking-down-extension-insta.patch Patch60: 0001-windowPreview-Override-with-window-icon-if-available.patch Patch61: screencast-bus-name.patch +Patch62: fix-inhibit-shortcut-permission.patch %define eds_version 3.33.1 %define gnome_desktop_version 3.35.91 @@ -281,6 +282,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de %{_mandir}/man1/gnome-shell.1* %changelog +* Wed May 15 2024 Florian Müllner - 40.10-20 +- Fix inhibit-shortcut permissions + Resolves: #RHEL-2031 + * Wed May 15 2024 Michael Catanzaro - 40.10-19 - Use correct bus name for screencast service Related: RHEL-35775