patch 9.2.0123: GTK: using deprecated gdk_pixbuf_new_from_xpm_data()

Commit: 
https://github.com/vim/vim/commit/6c0321fb9dda69a032c9a0dc3dd5f5cb5a24f944
Author: Christian Brabandt <[email protected]>
Date:   Sun Mar 8 20:10:03 2026 +0000

    patch 9.2.0123: GTK: using deprecated gdk_pixbuf_new_from_xpm_data()
    
    Problem:  GTK: gdk_pixbuf_new_from_xpm_data() is deprecated since
              2.44.5, causing build warnings
    Solution: Replace XPM icon loading with PNG byte arrays loaded via
              g_memory_input_stream_new_from_data() and
              gdk_pixbuf_new_from_stream(). These APIs are available since
              GLib 2.12 and gdk-pixbuf 2.14 (around 2008) so should be safe
              to use today.
    
    fixes:  #19446
    closes: #19583
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/Filelist b/Filelist
index 4b71b2aee..82329c700 100644
--- a/Filelist
+++ b/Filelist
@@ -941,12 +941,15 @@ RT_UNIX_DOS_BIN = \
                runtime/vim16x16.gif \
                runtime/vim16x16.png \
                runtime/vim16x16.xpm \
+               runtime/vim16x16_png.h \
                runtime/vim32x32.gif \
                runtime/vim32x32.png \
                runtime/vim32x32.xpm \
+               runtime/vim32x32_png.h \
                runtime/vim48x48.gif \
                runtime/vim48x48.png \
                runtime/vim48x48.xpm \
+               runtime/vim48x48_png.h \
 
 # Runtime not for Unix-like or extra.
 RT_NO_UNIX =   \
diff --git a/runtime/vim16x16_png.h b/runtime/vim16x16_png.h
new file mode 100644
index 000000000..5f817d5e3
--- /dev/null
+++ b/runtime/vim16x16_png.h
@@ -0,0 +1,23 @@
+/* PNG icon data, converted from vim16x16.png */
+static const unsigned char vim16x16_png[] = {
+    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+    0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10,
+    0x04, 0x03, 0x00, 0x00, 0x00, 0xed, 0xdd, 0xe2, 0x52, 0x00, 0x00, 0x00,
+    0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61,
+    0x05, 0x00, 0x00, 0x00, 0x18, 0x50, 0x4c, 0x54, 0x45, 0xbd, 0xbd, 0xbd,
+    0x00, 0xff, 0x00, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80,
+    0xff, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x31, 0x8b, 0xdc,
+    0x1f, 0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6,
+    0xd8, 0x66, 0x00, 0x00, 0x00, 0x68, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c,
+    0x25, 0xcb, 0xb1, 0x0d, 0x03, 0x31, 0x0c, 0x03, 0x40, 0xa6, 0xf2, 0x06,
+    0x19, 0x80, 0x2a, 0x34, 0x41, 0xe0, 0x36, 0x33, 0x18, 0x30, 0xb2, 0x81,
+    0xd5, 0x2a, 0x02, 0xf2, 0x5a, 0x3f, 0xb2, 0x9f, 0xd5, 0x81, 0x20, 0x81,
+    0xcc, 0xaf, 0x67, 0x02, 0x6d, 0xce, 0x8f, 0xcd, 0xe9, 0x68, 0xa4, 0x24,
+    0xd9, 0x81, 0x60, 0xb7, 0x21, 0x7e, 0xf0, 0xdb, 0xc5, 0xc6, 0x90, 0x1a,
+    0x3f, 0x82, 0x2f, 0xf6, 0xe5, 0x78, 0x06, 0x87, 0x5c, 0xcb, 0x70, 0x05,
+    0x99, 0x6b, 0xbd, 0xd1, 0x82, 0xaa, 0x69, 0x67, 0xac, 0xc9, 0x38, 0xf7,
+    0x50, 0x52, 0x0b, 0x92, 0x5a, 0x29, 0x74, 0xbb, 0xd1, 0x3c, 0x6e, 0x6c,
+    0x56, 0xfe, 0x39, 0x99, 0x1f, 0x4d, 0x9c, 0x32, 0x25, 0x09, 0x00, 0x00,
+    0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+};
+static const unsigned int vim16x16_png_len = sizeof(vim16x16_png);
diff --git a/runtime/vim32x32_png.h b/runtime/vim32x32_png.h
new file mode 100644
index 000000000..a1eac1a2b
--- /dev/null
+++ b/runtime/vim32x32_png.h
@@ -0,0 +1,33 @@
+/* PNG icon data, converted from vim32x32.png */
+static const unsigned char vim32x32_png[] = {
+    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+    0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
+    0x04, 0x03, 0x00, 0x00, 0x00, 0x81, 0x54, 0x67, 0xc7, 0x00, 0x00, 0x00,
+    0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61,
+    0x05, 0x00, 0x00, 0x00, 0x18, 0x50, 0x4c, 0x54, 0x45, 0xbd, 0xbd, 0xbd,
+    0x00, 0xff, 0x00, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80,
+    0xff, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x31, 0x8b, 0xdc,
+    0x1f, 0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6,
+    0xd8, 0x66, 0x00, 0x00, 0x00, 0xe1, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91,
+    0x55, 0x92, 0xc1, 0x0a, 0x83, 0x30, 0x0c, 0x40, 0x73, 0xeb, 0x1f, 0xcc,
+    0x7b, 0x1c, 0xf4, 0x3e, 0x19, 0xfe, 0xc0, 0xc0, 0xfb, 0x40, 0x76, 0x1e,
+    0x8c, 0xf4, 0xaa, 0x9d, 0x36, 0xbf, 0xbf, 0x24, 0x8d, 0x95, 0xa5, 0x48,
+    0xea, 0xe3, 0xb5, 0x89, 0x41, 0x80, 0x1a, 0x61, 0x81, 0xff, 0x58, 0xbb,
+    0xb6, 0x0d, 0xac, 0x71, 0x79, 0x2f, 0x9a, 0xd4, 0xdb, 0x67, 0x8d, 0x42,
+    0x9d, 0xa6, 0x97, 0x02, 0xd4, 0x88, 0x94, 0x9e, 0x9a, 0x45, 0x09, 0x06,
+    0x46, 0xa2, 0x2c, 0xa9, 0xd7, 0x33, 0x5f, 0xd9, 0x0c, 0x85, 0x28, 0xdd,
+    0x24, 0x2f, 0x7e, 0x46, 0x04, 0x92, 0xdc, 0x8f, 0x70, 0x82, 0x34, 0xbb,
+    0x70, 0x80, 0xfd, 0xe9, 0x82, 0x83, 0x53, 0x70, 0x60, 0xc2, 0x64, 0x9d,
+    0x1a, 0x30, 0xa1, 0x7c, 0x54, 0x59, 0x0d, 0x98, 0x40, 0x24, 0x4a, 0xb8,
+    0x18, 0x98, 0x6b, 0x2f, 0xa2, 0xac, 0x5a, 0x1f, 0xef, 0x55, 0x50, 0xc5,
+    0x41, 0x15, 0x14, 0xd4, 0x23, 0x37, 0x17, 0xf4, 0xd6, 0xb5, 0x7e, 0x2e,
+    0xbb, 0xe0, 0x65, 0x31, 0x62, 0x71, 0xc1, 0x07, 0x52, 0xc1, 0xd4, 0x3a,
+    0xc5, 0x91, 0x93, 0x2c, 0x6e, 0x46, 0x9f, 0xd1, 0x56, 0x3c, 0xc0, 0xc0,
+    0xc8, 0xe8, 0x23, 0x04, 0x1b, 0x4c, 0x8e, 0x8c, 0x0f, 0xe4, 0xc3, 0x18,
+    0x4a, 0x8e, 0xf9, 0x2a, 0x8f, 0x03, 0x69, 0x4a, 0x5f, 0x4e, 0x30, 0x70,
+    0x42, 0xb6, 0x65, 0x55, 0x82, 0x4c, 0x8e, 0xa5, 0x11, 0x05, 0x66, 0x80,
+    0x54, 0x0f, 0xbc, 0x31, 0x30, 0xd4, 0x3e, 0x2c, 0xb6, 0x09, 0xfe, 0xa3,
+    0xfd, 0x0e, 0x3f, 0x3a, 0x97, 0x6a, 0xfd, 0x61, 0x21, 0x10, 0x56, 0x00,
+    0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+};
+static const unsigned int vim32x32_png_len = sizeof(vim32x32_png);
diff --git a/runtime/vim48x48_png.h b/runtime/vim48x48_png.h
new file mode 100644
index 000000000..ecd0fbf00
--- /dev/null
+++ b/runtime/vim48x48_png.h
@@ -0,0 +1,44 @@
+/* PNG icon data, converted from vim48x48.png */
+static const unsigned char vim48x48_png[] = {
+    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+    0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30,
+    0x04, 0x03, 0x00, 0x00, 0x00, 0xa5, 0x2c, 0xe4, 0xb4, 0x00, 0x00, 0x00,
+    0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61,
+    0x05, 0x00, 0x00, 0x00, 0x18, 0x50, 0x4c, 0x54, 0x45, 0xbd, 0xbd, 0xbd,
+    0x00, 0x00, 0x84, 0x00, 0xff, 0x00, 0x84, 0x82, 0x84, 0xff, 0xff, 0xff,
+    0x00, 0x82, 0x00, 0xc6, 0xc3, 0xc6, 0x00, 0x00, 0x00, 0xe4, 0x68, 0x2c,
+    0x77, 0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6,
+    0xd8, 0x66, 0x00, 0x00, 0x01, 0x60, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c,
+    0x75, 0x94, 0x4b, 0x8e, 0xc3, 0x20, 0x0c, 0x40, 0xd9, 0x79, 0xcd, 0x22,
+    0xca, 0x09, 0xaa, 0x1c, 0x80, 0xaa, 0x1c, 0x60, 0xaa, 0xce, 0xba, 0x95,
+    0x50, 0x0e, 0x10, 0x09, 0xb6, 0x49, 0xda, 0xc0, 0xf5, 0xc7, 0x60, 0x3e,
+    0xa6, 0xca, 0x58, 0x5e, 0x94, 0xbe, 0xbc, 0x98, 0xd8, 0x08, 0x21, 0x5a,
+    0xc0, 0x2a, 0xce, 0x63, 0x9f, 0xce, 0xff, 0x87, 0xcb, 0xeb, 0x4b, 0x09,
+    0x14, 0xbb, 0x31, 0x93, 0x80, 0xbc, 0x48, 0x4f, 0xde, 0x29, 0x7e, 0x8d,
+    0x79, 0xad, 0x9f, 0xbc, 0x88, 0xee, 0xe7, 0x61, 0x53, 0x2c, 0x07, 0x2a,
+    0x77, 0xfa, 0x6d, 0x75, 0x04, 0xb6, 0x81, 0xf9, 0xc1, 0xc1, 0x8d, 0x81,
+    0x1f, 0x06, 0x40, 0x25, 0xa2, 0xb4, 0xc1, 0x78, 0x2b, 0x7a, 0x48, 0xa7,
+    0x5d, 0x25, 0x5f, 0x1d, 0x11, 0xcc, 0xf4, 0x62, 0x95, 0x36, 0x0e, 0x1c,
+    0xdc, 0x9b, 0xd0, 0x01, 0xda, 0x22, 0x09, 0x1c, 0x74, 0x02, 0x07, 0x9d,
+    0xc0, 0x40, 0x2f, 0x30, 0xd0, 0x0b, 0x0d, 0x14, 0xa1, 0x80, 0xfa, 0x1d,
+    0x59, 0x38, 0xf2, 0x5c, 0x60, 0xca, 0xeb, 0x22, 0x98, 0x3c, 0x97, 0x7d,
+    0xce, 0xe0, 0x53, 0x6b, 0x4d, 0x34, 0xb8, 0x0c, 0x42, 0x11, 0x0c, 0x29,
+    0x7b, 0xee, 0xb5, 0x6a, 0x42, 0x52, 0xe0, 0x52, 0x40, 0x13, 0x92, 0xb2,
+    0x0f, 0x05, 0x30, 0x21, 0x4d, 0x5f, 0x66, 0x70, 0x65, 0x82, 0x79, 0x8e,
+    0x42, 0x6c, 0x03, 0x81, 0x1b, 0x17, 0x24, 0x56, 0x07, 0x59, 0x07, 0xdd,
+    0x09, 0xa8, 0x8c, 0x05, 0xb8, 0xc0, 0x04, 0x54, 0x2a, 0xf0, 0x96, 0xc0,
+    0x53, 0xf2, 0x5e, 0x31, 0x20, 0xbb, 0x79, 0x34, 0x40, 0x15, 0x18, 0x58,
+    0x74, 0xe8, 0x84, 0x0a, 0x54, 0x38, 0xe6, 0x98, 0x1b, 0x9d, 0xe9, 0x0a,
+    0x16, 0xed, 0x9d, 0xb7, 0x94, 0xfc, 0x94, 0xa0, 0x60, 0xdd, 0x5c, 0x36,
+    0xce, 0xc0, 0xa2, 0xe7, 0x73, 0x80, 0x13, 0xb4, 0x98, 0x21, 0xc4, 0x64,
+    0xaf, 0xc2, 0x6e, 0xe0, 0x6e, 0xbd, 0xdd, 0xb0, 0x40, 0x57, 0x03, 0xdb,
+    0xe7, 0x1d, 0xa6, 0xf4, 0x4e, 0x78, 0xd7, 0x76, 0x85, 0x42, 0x2a, 0xe1,
+    0x46, 0xeb, 0xc0, 0x32, 0xa0, 0xb0, 0xfb, 0xa9, 0x04, 0xd8, 0x15, 0x6c,
+    0x6b, 0xc9, 0xa2, 0x41, 0xa6, 0x12, 0x2b, 0x2b, 0x21, 0xc4, 0x5b, 0xe1,
+    0xa9, 0xdc, 0xca, 0xc7, 0xc5, 0x2c, 0x3d, 0x89, 0x3d, 0x80, 0x31, 0x1c,
+    0x63, 0x58, 0x21, 0x65, 0x77, 0x0f, 0x6c, 0x43, 0x6d, 0x6b, 0x1f, 0x20,
+    0xe5, 0x3f, 0xb7, 0xcc, 0x76, 0x2e, 0x7c, 0x5d, 0x4b, 0x7f, 0xd1, 0xdd,
+    0x21, 0x90, 0x5f, 0x34, 0x48, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
+    0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+};
+static const unsigned int vim48x48_png_len = sizeof(vim48x48_png);
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index 16f145d99..a238a8ab9 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -1468,8 +1468,8 @@ lua_env :
 [.$(DEST)]gui_gtk_x11.obj : gui_gtk_x11.c vim.h [.$(DEST)]config.h feature.h 
os_unix.h \
  ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
  gui.h beval.h option.h ex_cmds.h proto.h \
- errors.h globals.h gui_gtk_f.h [-.runtime]vim32x32.xpm \
- [-.runtime]vim16x16.xpm [-.runtime]vim48x48.xpm version.h
+ errors.h globals.h gui_gtk_f.h [-.runtime]vim32x32_png.h \
+ [-.runtime]vim16x16_png.h [-.runtime]vim48x48_png.h version.h
 [.$(DEST)]gui_x11.obj : gui_x11.c vim.h [.$(DEST)]config.h feature.h os_unix.h 
\
  ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \
  gui.h beval.h option.h ex_cmds.h proto.h \
diff --git a/src/Makefile b/src/Makefile
index 99c77cb34..949369194 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4469,8 +4469,8 @@ objects/gui_gtk_x11.o: auto/osdef.h gui_gtk_x11.c vim.h 
protodef.h auto/config.h
  beval.h structs.h regexp.h gui.h \
  libvterm/include/vterm.h libvterm/include/vterm_keycodes.h alloc.h \
  ex_cmds.h spell.h proto.h globals.h errors.h auto/gui_gtk_gresources.h \
- gui_gtk_f.h ../runtime/vim16x16.xpm ../runtime/vim32x32.xpm \
- ../runtime/vim48x48.xpm
+ gui_gtk_f.h ../runtime/vim16x16_png.h ../runtime/vim32x32_png.h \
+ ../runtime/vim48x48_png.h
 objects/gui_x11.o: auto/osdef.h gui_x11.c vim.h protodef.h auto/config.h 
feature.h os_unix.h \
  ascii.h keymap.h termdefs.h macros.h option.h beval.h \
  structs.h regexp.h gui.h libvterm/include/vterm.h \
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 493ba56ef..785d3069c 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -2720,15 +2720,27 @@ gui_gtk_uninit_socket_server(void)
 
 #endif
 
+    static GdkPixbuf *
+pixbuf_new_from_png_data(const unsigned char *data, unsigned int len)
+{
+    GInputStream *stream;
+    GdkPixbuf    *pixbuf;
+
+    stream = g_memory_input_stream_new_from_data(data, len, NULL);
+    pixbuf = gdk_pixbuf_new_from_stream(stream, NULL, NULL);
+    g_object_unref(stream);
+    return pixbuf;
+}
+
 /*
  * Setup the window icon & xcmdsrv comm after the main window has been 
realized.
  */
     static void
 mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
 {
-#include "../runtime/vim16x16.xpm"
-#include "../runtime/vim32x32.xpm"
-#include "../runtime/vim48x48.xpm"
+#include "../runtime/vim16x16_png.h"
+#include "../runtime/vim32x32_png.h"
+#include "../runtime/vim48x48_png.h"
 
     GdkWindow * const mainwin_win = gtk_widget_get_window(gui.mainwin);
 
@@ -2757,9 +2769,9 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data 
UNUSED)
             */
            GList *icons = NULL;
 
-           icons = g_list_prepend(icons, gdk_pixbuf_new_from_xpm_data((const 
char **)vim16x16));
-           icons = g_list_prepend(icons, gdk_pixbuf_new_from_xpm_data((const 
char **)vim32x32));
-           icons = g_list_prepend(icons, gdk_pixbuf_new_from_xpm_data((const 
char **)vim48x48));
+           icons = g_list_prepend(icons, 
pixbuf_new_from_png_data(vim16x16_png, vim16x16_png_len));
+           icons = g_list_prepend(icons, 
pixbuf_new_from_png_data(vim32x32_png, vim32x32_png_len));
+           icons = g_list_prepend(icons, 
pixbuf_new_from_png_data(vim48x48_png, vim48x48_png_len));
 
            gtk_window_set_icon_list(GTK_WINDOW(gui.mainwin), icons);
 
diff --git a/src/version.c b/src/version.c
index 4c34ea9ae..446c47fe0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    123,
 /**/
     122,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vzKWl-00DJH5-UV%40256bit.org.

Raspunde prin e-mail lui