]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kconfig: gconf: use GdkPixbuf in replace_button_icon()
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 24 Jun 2025 15:05:26 +0000 (00:05 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 2 Jul 2025 01:36:15 +0000 (10:36 +0900)
gdk_pixmap_create_from_xpm_d has been deprecated since version 2.22.
Use a GdkPixbuf instead. You can use gdk_pixbuf_new_from_xpm_data() to
create it. [1]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gdk/gdkpixmap.c#L742

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/gconf.c

index 82e8edb8a82ceede3845100c56551a0ac6260596..2eac486cec5b7f9f23ed107f829a9c75ccdcda52 100644 (file)
@@ -1103,17 +1103,16 @@ static void fixup_rootmenu(struct menu *menu)
 static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
                                GtkStyle *style, gchar *btn_name, gchar **xpm)
 {
-       GdkPixmap *pixmap;
-       GdkBitmap *mask;
-       GtkToolButton *button;
+       GdkPixbuf *pixbuf;
        GtkWidget *image;
+       GtkToolButton *button;
 
-       pixmap = gdk_pixmap_create_from_xpm_d(window, &mask,
-                                             &style->bg[GTK_STATE_NORMAL],
-                                             xpm);
+       pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm);
+       image = gtk_image_new_from_pixbuf(pixbuf);
+       g_object_unref(pixbuf);
 
        button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name));
-       image = gtk_image_new_from_pixmap(pixmap, mask);
+
        gtk_widget_show(image);
        gtk_tool_button_set_icon_widget(button, image);
 }