From 15d98ae683d8643aaf9fde797f0efb3556515924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 9 Oct 2023 20:16:02 +0200 Subject: [PATCH] docking: Use St.IconTheme directly, without wrappers The old code was using Gtk as fallback to support old versions but this is not the case anymore. --- docking.js | 6 +++--- utils.js | 28 ---------------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/docking.js b/docking.js index 7bcc96eb7..8f2e602ea 100644 --- a/docking.js +++ b/docking.js @@ -1653,7 +1653,7 @@ export class DockManager { this._appSwitcherSettings = new Gio.Settings({schema_id: 'org.gnome.shell.app-switcher'}); this._mapSettingsValues(); - this._iconTheme = new Utils.IconTheme(); + this._iconTheme = new St.IconTheme(); this._desktopIconsUsableArea = new DesktopIconsIntegration.DesktopIconsUsableAreaClass(); this._oldDash = Main.overview.isDummy ? null : Main.overview.dash; @@ -1740,7 +1740,7 @@ export class DockManager { } get iconTheme() { - return this._iconTheme.iconTheme; + return this._iconTheme; } get fm1Client() { @@ -2647,7 +2647,7 @@ export class DockManager { Locations.unWrapFileManagerApp(); this._removables?.destroy(); this._removables = null; - this._iconTheme.destroy(); + this._iconTheme = null; this._remoteModel?.destroy(); this._settings = null; this._appSwitcherSettings = null; diff --git a/utils.js b/utils.js index 81d27a90f..db3292e35 100644 --- a/utils.js +++ b/utils.js @@ -3,7 +3,6 @@ import { GLib, Gio, GObject, - Gtk, Meta, Shell, St, @@ -490,33 +489,6 @@ export function splitHandler(handler) { }); } -export class IconTheme { - constructor() { - if (St.IconTheme) { - this._iconTheme = new St.IconTheme(); - return; - } - - const settings = St.Settings.get(); - this._iconTheme = new Gtk.IconTheme(); - this._iconTheme.set_custom_theme(settings.gtkIconTheme); - this._changesId = settings.connect('notify::gtk-icon-theme', () => { - this._iconTheme.set_custom_theme(settings.gtkIconTheme); - }); - } - - get iconTheme() { - return this._iconTheme; - } - - destroy() { - if (this._changesId) - St.Settings.get().disconnect(this._changesId); - - this._iconTheme = null; - } -} - /** * Construct a map of gtk application window object paths to MetaWindows. */