From 7f048a25d5085fadada164042a5edcb3f82ec468 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 18 Jun 2021 12:45:33 +0200 Subject: [PATCH] Resolves: #1973391 (Backport downstream patch from older RHEL) --- desktop-icons-classic-mode.patch | 35 ++++++++++++++++++++++++++++++++ gnome-tweaks.spec | 9 ++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 desktop-icons-classic-mode.patch diff --git a/desktop-icons-classic-mode.patch b/desktop-icons-classic-mode.patch new file mode 100644 index 0000000..16b7f63 --- /dev/null +++ b/desktop-icons-classic-mode.patch @@ -0,0 +1,35 @@ +diff -up gnome-tweaks-40.0/gtweak/tweaks/tweak_group_desktop.py.1 gnome-tweaks-40.0/gtweak/tweaks/tweak_group_desktop.py +--- gnome-tweaks-40.0/gtweak/tweaks/tweak_group_desktop.py.1 2021-03-27 22:15:34.200934600 +0100 ++++ gnome-tweaks-40.0/gtweak/tweaks/tweak_group_desktop.py 2021-06-18 12:39:37.112857745 +0200 +@@ -3,8 +3,17 @@ + # License-Filename: LICENSES/GPL-3.0 + + from gtweak.widgets import ListBoxTweakGroup, GSettingsSwitchTweak, Title ++from gtweak.gshellwrapper import GnomeShellFactory + +-dicons = GSettingsSwitchTweak(_("Show Icons"),"org.gnome.desktop.background","show-desktop-icons") ++_shell = GnomeShellFactory().get_shell() ++_shell_is_classic = False ++ ++if (not(_shell is None)): ++ _shell_is_classic = _shell.mode == 'classic' ++ ++dicons = None ++if (not(_shell_is_classic)): ++ dicons = GSettingsSwitchTweak(_("Show Icons"),"org.gnome.desktop.background","show-desktop-icons") + + # show-desktop-icons is in gsettings-desktop-schemas, but it won't actually + # *work* unless we have a version of Nautilus that still has the ability to +diff -up gnome-tweaks-40.0/gtweak/widgets.py.1 gnome-tweaks-40.0/gtweak/widgets.py +--- gnome-tweaks-40.0/gtweak/widgets.py.1 2021-06-18 12:39:37.112857745 +0200 ++++ gnome-tweaks-40.0/gtweak/widgets.py 2021-06-18 12:40:59.950824933 +0200 +@@ -207,6 +207,9 @@ class ListBoxTweakGroup(Gtk.ListBox, Twe + # the search cache etc) + + def add_tweak_row(self, t, activatable=False, position=None): ++ if t == None: ++ return None ++ + if self.add_tweak(t): + if isinstance(t, Gtk.ListBoxRow): + row = t diff --git a/gnome-tweaks.spec b/gnome-tweaks.spec index fe89de8..5f44b7c 100644 --- a/gnome-tweaks.spec +++ b/gnome-tweaks.spec @@ -3,7 +3,7 @@ Name: gnome-tweaks Version: 40.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Customize advanced GNOME 3 options # Software is GPLv3, Appdata file is CC0-1.0 @@ -11,6 +11,8 @@ License: GPLv3 and CC0 URL: https://wiki.gnome.org/Apps/Tweaks Source0: https://download.gnome.org/sources/%{name}/%{major_version}/%{name}-%{tarball_version}.tar.xz +Patch01: desktop-icons-classic-mode.patch + BuildRequires: desktop-file-utils BuildRequires: gettext BuildRequires: libappstream-glib @@ -41,7 +43,7 @@ and extension, etc. %prep -%autosetup -n %{name}-%{tarball_version} +%autosetup -n %{name}-%{tarball_version} -p1 -S gendiff %build @@ -75,6 +77,9 @@ appstream-util validate-relax --nonet $RPM_BUILD_ROOT/%{_datadir}/metainfo/*.app %changelog +* Fri Jun 18 2021 Milan Crha - 40.0-4 +- Resolves: #1973391 (Backport downstream patch from older RHEL) + * Thu Apr 15 2021 Mohan Boddu - 40.0-3 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937