]> git.eshelyaron.com Git - emacs.git/commitdiff
* gtkutil.c (xg_set_frame_icon): New function.
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 16 Aug 2005 19:33:40 +0000 (19:33 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 16 Aug 2005 19:33:40 +0000 (19:33 +0000)
src/gtkutil.c

index 0e0f6cd898aa368c1b7594b9e61e132c42312645..3b590e0faed92518dd6dee47507401a8433acf3c 100644 (file)
@@ -241,7 +241,7 @@ xg_create_default_cursor (dpy)
 
 /* 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 @@ xg_set_background_color (f, bg)
 }
 
 
+/* 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);
+}
+
+
 \f
 /***********************************************************************
                       Dialog functions