]> granicus.if.org Git - vim/commitdiff
patch 8.2.1645: GTK3: icons become broken images when resized v8.2.1645
authorBram Moolenaar <Bram@vim.org>
Wed, 9 Sep 2020 17:05:13 +0000 (19:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Sep 2020 17:05:13 +0000 (19:05 +0200)
Problem:    GTK3: icons become broken images when resized.
Solution:   Use gtk_image_new_from_icon_name(). (closes #6916)
            Fix compiler warnings.

src/gui_gtk_x11.c
src/version.c

index 341db3d5a9abd7479af3a80c23e9b42692ed0e6c..fe1ac58782eb05674291ddc82081f202eacc8a56 100644 (file)
@@ -2555,7 +2555,8 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
 
        gtk_window_set_icon_list(GTK_WINDOW(gui.mainwin), icons);
 
-       g_list_foreach(icons, (GFunc)&g_object_unref, NULL);
+       // TODO: is this type cast OK?
+       g_list_foreach(icons, (GFunc)(void *)&g_object_unref, NULL);
        g_list_free(icons);
     }
 
@@ -3092,8 +3093,8 @@ icon_size_changed_foreach(GtkWidget *widget, gpointer user_data)
            const gchar *icon_name;
 
            gtk_image_get_icon_name(image, &icon_name, NULL);
-
-           gtk_image_set_from_icon_name(image, icon_name, icon_size);
+           image = (GtkImage *)gtk_image_new_from_icon_name(
+                                                        icon_name, icon_size);
        }
 # else
        // User-defined icons are stored in a GtkIconSet
@@ -4967,7 +4968,8 @@ ascii_glyph_table_init(void)
        }
     }
 
-    g_list_foreach(item_list, (GFunc)&pango_item_free, NULL);
+    // TODO: is this type cast OK?
+    g_list_foreach(item_list, (GFunc)(void *)&pango_item_free, NULL);
     g_list_free(item_list);
     pango_attr_list_unref(attr_list);
 }
index 1d1e00e61fe5c6314141b41ef206775e8a170af4..d108c1783e6e835f6e9dc24a05cd9155b22ae5ab 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1645,
 /**/
     1644,
 /**/