Skip to content

Commit 81a4cf4

Browse files
committed
patch 8.2.1645: GTK3: icons become broken images when resized
Problem: GTK3: icons become broken images when resized. Solution: Use gtk_image_new_from_icon_name(). (closes #6916) Fix compiler warnings.
1 parent ba7c0d7 commit 81a4cf4

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/gui_gtk_x11.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,8 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
25552555

25562556
gtk_window_set_icon_list(GTK_WINDOW(gui.mainwin), icons);
25572557

2558-
g_list_foreach(icons, (GFunc)&g_object_unref, NULL);
2558+
// TODO: is this type cast OK?
2559+
g_list_foreach(icons, (GFunc)(void *)&g_object_unref, NULL);
25592560
g_list_free(icons);
25602561
}
25612562

@@ -3092,8 +3093,8 @@ icon_size_changed_foreach(GtkWidget *widget, gpointer user_data)
30923093
const gchar *icon_name;
30933094

30943095
gtk_image_get_icon_name(image, &icon_name, NULL);
3095-
3096-
gtk_image_set_from_icon_name(image, icon_name, icon_size);
3096+
image = (GtkImage *)gtk_image_new_from_icon_name(
3097+
icon_name, icon_size);
30973098
}
30983099
# else
30993100
// User-defined icons are stored in a GtkIconSet
@@ -4967,7 +4968,8 @@ ascii_glyph_table_init(void)
49674968
}
49684969
}
49694970

4970-
g_list_foreach(item_list, (GFunc)&pango_item_free, NULL);
4971+
// TODO: is this type cast OK?
4972+
g_list_foreach(item_list, (GFunc)(void *)&pango_item_free, NULL);
49714973
g_list_free(item_list);
49724974
pango_attr_list_unref(attr_list);
49734975
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1645,
757759
/**/
758760
1644,
759761
/**/

0 commit comments

Comments
 (0)