# HG changeset patch # User Jan Dj¸«£rv # Date 1124220820 0 # Node ID ec2fa2e1d4ea1c5572466dbc0bb1a03039364a78 # Parent 5a24bf173f5c539ef48fb7485ff1111266679526 * gtkutil.c (xg_set_frame_icon): New function. diff -r 5a24bf173f5c -r ec2fa2e1d4ea src/gtkutil.c --- a/src/gtkutil.c Tue Aug 16 19:33:07 2005 +0000 +++ b/src/gtkutil.c Tue Aug 16 19:33:40 2005 +0000 @@ -241,7 +241,7 @@ /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ -GdkPixbuf * +static GdkPixbuf * xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) GdkPixmap *gpix; GdkPixmap *gmask; @@ -952,6 +952,24 @@ } +/* Set the frame icon to ICON_PIXMAP/MASK. This must be done with GTK + functions so GTK does not overwrite the icon. */ + +void +xg_set_frame_icon (f, icon_pixmap, icon_mask) + FRAME_PTR f; + Pixmap icon_pixmap; + Pixmap icon_mask; +{ + GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); + GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap); + GdkPixmap *gmask = gdk_pixmap_foreign_new_for_display (gdpy, icon_mask); + GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, NULL); + + gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp); +} + + /*********************************************************************** Dialog functions