Skip to content

Commit

Permalink
docking: Use St.IconTheme directly, without wrappers
Browse files Browse the repository at this point in the history
The old code was using Gtk as fallback to support old versions but this
is not the case anymore.
  • Loading branch information
3v1n0 committed Oct 9, 2023
1 parent 5ad92ae commit 15d98ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
6 changes: 3 additions & 3 deletions docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1740,7 +1740,7 @@ export class DockManager {
}

get iconTheme() {
return this._iconTheme.iconTheme;
return this._iconTheme;
}

get fm1Client() {
Expand Down Expand Up @@ -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;
Expand Down
28 changes: 0 additions & 28 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
GLib,
Gio,
GObject,
Gtk,
Meta,
Shell,
St,
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit 15d98ae

Please sign in to comment.