Skip to content

Commit

Permalink
Merge branch 'master' into leolost/desktopintegration-activate-window…
Browse files Browse the repository at this point in the history
…-with-workspace
  • Loading branch information
danirabbit authored May 30, 2024
2 parents d3427ce + 54afc63 commit 77485bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ namespace Gala {

private static AppCache app_cache;

private static Gtk.IconTheme icon_theme;

static construct {
icon_theme = new Gtk.IconTheme ();
icon_theme.set_custom_theme ("elementary");
icon_cache = new Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> ();
window_to_desktop_cache = new Gee.HashMap<Meta.Window, DesktopAppInfo> ();
unknown_icon_cache = new Gee.ArrayList<CachedIcon?> ();
Expand Down Expand Up @@ -155,7 +159,7 @@ namespace Gala {

// Construct a new "application-default-icon" and store it in the cache
try {
var icon = Gtk.IconTheme.get_default ().load_icon_for_scale ("application-default-icon", icon_size, scale, 0);
var icon = icon_theme.load_icon_for_scale ("application-default-icon", icon_size, scale, 0);
unknown_icon_cache.add (CachedIcon () { icon = icon, icon_size = icon_size, scale = scale });
return icon;
} catch (Error e) {
Expand Down Expand Up @@ -224,7 +228,7 @@ namespace Gala {

if (icon is GLib.ThemedIcon) {
var icon_names = ((GLib.ThemedIcon)icon).get_names ();
var icon_info = Gtk.IconTheme.get_default ().choose_icon_for_scale (icon_names, icon_size, scale, 0);
var icon_info = icon_theme.choose_icon_for_scale (icon_names, icon_size, scale, 0);

if (icon_info == null) {
return null;
Expand Down

0 comments on commit 77485bb

Please sign in to comment.