b=714068 use gtk_icon_theme_get_icon_sizes instead of gtk_icon_theme_has_icon to determine whether GtkWindow will use an icon r=karlt
authorJean-Alexandre Anglès d'Auriac <jagw40k@free.fr>
Wed, 11 Jan 2012 15:41:28 +1300
changeset 84233 6d755ac01cbb8fb569d1b4d806c232766bb2deaa
parent 84232 912022fc07417a32adb048fee36fd93ab35d73c0
child 84234 53a8a6b4c812103b51e17023410224ea14b0de40
push id21832
push userbmo@edmorley.co.uk
push dateWed, 11 Jan 2012 17:04:15 +0000
treeherdermozilla-central@40c9f9ff9fd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs714068
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
b=714068 use gtk_icon_theme_get_icon_sizes instead of gtk_icon_theme_has_icon to determine whether GtkWindow will use an icon r=karlt
widget/gtk2/nsWindow.cpp
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -1825,18 +1825,21 @@ nsWindow::SetIcon(const nsAString& aIcon
         ToLowerCase(iconName);
     } else {
         AppendUTF16toUTF8(aIconSpec, iconName);
     }
     
     nsCOMPtr<nsILocalFile> iconFile;
     nsCAutoString path;
 
-    bool foundIcon = gtk_icon_theme_has_icon(gtk_icon_theme_get_default(),
-                                             iconName.get());
+    gint *iconSizes =
+        gtk_icon_theme_get_icon_sizes(gtk_icon_theme_get_default(),
+                                      iconName.get());
+    bool foundIcon = (iconSizes[0] != 0);
+    g_free(iconSizes);
 
     if (!foundIcon) {
         // Look for icons with the following suffixes appended to the base name
         // The last two entries (for the old XPM format) will be ignored unless
         // no icons are found using other suffixes. XPM icons are deprecated.
 
         const char extensions[6][7] = { ".png", "16.png", "32.png", "48.png",
                                     ".xpm", "16.xpm" };