@@ -34,8 +34,10 @@ namespace Gala {
3434 private static Gtk . IconTheme icon_theme;
3535
3636 static construct {
37- icon_theme = new Gtk .IconTheme ();
38- icon_theme. set_custom_theme (" elementary" );
37+ icon_theme = new Gtk .IconTheme () {
38+ theme_name = " elementary"
39+ };
40+
3941 icon_cache = new Gee .HashMultiMap<DesktopAppInfo , CachedIcon ?> ();
4042 window_to_desktop_cache = new Gee .HashMap<Meta . Window , DesktopAppInfo > ();
4143 unknown_icon_cache = new Gee .ArrayList<CachedIcon ?> ();
@@ -159,9 +161,19 @@ namespace Gala {
159161
160162 // Construct a new "application-default-icon" and store it in the cache
161163 try {
162- var icon = icon_theme. load_icon_for_scale (" application-default-icon" , icon_size, scale, 0 );
163- unknown_icon_cache. add (CachedIcon () { icon = icon, icon_size = icon_size, scale = scale });
164- return icon;
164+ var icon_paintable = icon_theme. lookup_icon (
165+ " application-default-icon" ,
166+ null ,
167+ icon_size,
168+ scale,
169+ Gtk . TextDirection . NONE ,
170+ 0
171+ );
172+
173+ var pixbuf = new Gdk .Pixbuf .from_file (icon_paintable. get_file (). get_path ());
174+
175+ unknown_icon_cache. add (CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale });
176+ return pixbuf;
165177 } catch (Error e) {
166178 var icon = new Gdk .Pixbuf (Gdk . Colorspace . RGB , true , 8 , icon_size * scale, icon_size * scale);
167179 icon. fill (0x00000000 );
@@ -228,14 +240,19 @@ namespace Gala {
228240
229241 if (icon is GLib . ThemedIcon ) {
230242 var icon_names = ((GLib . ThemedIcon )icon). get_names ();
231- var icon_info = icon_theme. choose_icon_for_scale (icon_names, icon_size, scale, 0 );
243+ if (icon_names. length == 0 ) {
244+ return null ;
245+ }
246+
247+ var icon_paintable = icon_theme. lookup_icon (icon_names[0 ], icon_names[1 : ], icon_size, scale, NONE , 0 );
232248
233- if (icon_info == null ) {
249+ var path = icon_paintable. get_file ()? . get_path ();
250+ if (path == null ) {
234251 return null ;
235252 }
236253
237254 try {
238- var pixbuf = icon_info . load_icon ( );
255+ var pixbuf = new Gdk . Pixbuf .from_file (path );
239256 icon_cache. @set (desktop, CachedIcon () { icon = pixbuf, icon_size = icon_size, scale = scale });
240257 return pixbuf;
241258 } catch (Error e) {
0 commit comments