mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Use gtk_window_set_icon() where available.
GTK is deprecating the use of gdk_window_set_icon(), in favour of a method that doesn't have to drop down to the GDK level at all (and also doesn't use a pixmap). No reason not to use that instead.
This commit is contained in:
parent
f853b695de
commit
0413cc856c
@ -3817,20 +3817,26 @@ static void update_savedsess_menu(GtkMenuItem *menuitem, gpointer data)
|
||||
void set_window_icon(GtkWidget *window, const char *const *const *icon,
|
||||
int n_icon)
|
||||
{
|
||||
GdkPixmap *iconpm;
|
||||
GdkBitmap *iconmask;
|
||||
#if GTK_CHECK_VERSION(2,0,0)
|
||||
GList *iconlist;
|
||||
int n;
|
||||
#else
|
||||
GdkPixmap *iconpm;
|
||||
GdkBitmap *iconmask;
|
||||
#endif
|
||||
|
||||
if (!n_icon)
|
||||
return;
|
||||
|
||||
gtk_widget_realize(window);
|
||||
#if GTK_CHECK_VERSION(2,0,0)
|
||||
gtk_window_set_icon(GTK_WINDOW(window),
|
||||
gdk_pixbuf_new_from_xpm_data((const gchar **)icon[0]));
|
||||
#else
|
||||
iconpm = gdk_pixmap_create_from_xpm_d(gtk_widget_get_window(window),
|
||||
&iconmask, NULL, (gchar **)icon[0]);
|
||||
gdk_window_set_icon(gtk_widget_get_window(window), NULL, iconpm, iconmask);
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(2,0,0)
|
||||
iconlist = NULL;
|
||||
@ -3840,7 +3846,7 @@ void set_window_icon(GtkWidget *window, const char *const *const *icon,
|
||||
gdk_pixbuf_new_from_xpm_data((const gchar **)
|
||||
icon[n]));
|
||||
}
|
||||
gdk_window_set_icon_list(gtk_widget_get_window(window), iconlist);
|
||||
gtk_window_set_icon_list(GTK_WINDOW(window), iconlist);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user