diff options
| author | Jan Djärv | 2005-08-16 19:33:40 +0000 |
|---|---|---|
| committer | Jan Djärv | 2005-08-16 19:33:40 +0000 |
| commit | 1001243b675d98e2d22636a5ac4628c80a3a84a6 (patch) | |
| tree | 2c716c61eed2b743b9bd50d95bee11df9e44328c /src | |
| parent | 5dec4320267af6aaaaa37cc210e43839d6c30c17 (diff) | |
| download | emacs-1001243b675d98e2d22636a5ac4628c80a3a84a6.tar.gz emacs-1001243b675d98e2d22636a5ac4628c80a3a84a6.zip | |
* gtkutil.c (xg_set_frame_icon): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 0e0f6cd898a..3b590e0faed 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -241,7 +241,7 @@ xg_create_default_cursor (dpy) | |||
| 241 | 241 | ||
| 242 | /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ | 242 | /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ |
| 243 | 243 | ||
| 244 | GdkPixbuf * | 244 | static GdkPixbuf * |
| 245 | xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) | 245 | xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) |
| 246 | GdkPixmap *gpix; | 246 | GdkPixmap *gpix; |
| 247 | GdkPixmap *gmask; | 247 | GdkPixmap *gmask; |
| @@ -952,6 +952,24 @@ xg_set_background_color (f, bg) | |||
| 952 | } | 952 | } |
| 953 | 953 | ||
| 954 | 954 | ||
| 955 | /* Set the frame icon to ICON_PIXMAP/MASK. This must be done with GTK | ||
| 956 | functions so GTK does not overwrite the icon. */ | ||
| 957 | |||
| 958 | void | ||
| 959 | xg_set_frame_icon (f, icon_pixmap, icon_mask) | ||
| 960 | FRAME_PTR f; | ||
| 961 | Pixmap icon_pixmap; | ||
| 962 | Pixmap icon_mask; | ||
| 963 | { | ||
| 964 | GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); | ||
| 965 | GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap); | ||
| 966 | GdkPixmap *gmask = gdk_pixmap_foreign_new_for_display (gdpy, icon_mask); | ||
| 967 | GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, NULL); | ||
| 968 | |||
| 969 | gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp); | ||
| 970 | } | ||
| 971 | |||
| 972 | |||
| 955 | 973 | ||
| 956 | /*********************************************************************** | 974 | /*********************************************************************** |
| 957 | Dialog functions | 975 | Dialog functions |