summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2005-11-16 13:38:25 +0000
committerChong Yidong <cyd@stupidchicken.com>2005-11-16 13:38:25 +0000
commit54188d8fb089059864e3fb69a8d61799cc19a00d (patch)
tree104237ff085ae47be27e0c63075c03588b75e0c8
parente930091eb30562b0f7982de10d64de8fb4d9baec (diff)
downloademacs-54188d8fb089059864e3fb69a8d61799cc19a00d.tar.gz
initialize XpmAttributes
-rw-r--r--src/ChangeLog1
-rw-r--r--src/image.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 87262721177..d366093114b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -5,6 +5,7 @@
* xterm.c (x_bitmap_icon): Use the xpm if available.
* image.c (x_create_bitmap_from_xpm_data): New function.
+ (x_create_bitmap_from_xpm_data): Initialize XpmAttributes.
2005-11-15 Luc Teirlinck <teirllm@auburn.edu>
diff --git a/src/image.c b/src/image.c
index aec66eb3cb8..1ba1cd197ff 100644
--- a/src/image.c
+++ b/src/image.c
@@ -3729,6 +3729,11 @@ x_create_bitmap_from_xpm_data (f, bits)
bzero (&attrs, sizeof attrs);
+ attrs.visual = FRAME_X_VISUAL (f);
+ attrs.colormap = FRAME_X_COLORMAP (f);
+ attrs.valuemask |= XpmVisual;
+ attrs.valuemask |= XpmColormap;
+
rc = XpmCreatePixmapFromData (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
bits, &bitmap, &mask, &attrs);
if (rc != XpmSuccess)
@@ -3797,6 +3802,9 @@ xpm_load (f, img)
attrs.valuemask |= XpmCloseness;
#endif /* not XpmAllocCloseColors */
#endif /* ALLOC_XPM_COLORS */
+#ifdef ALLOC_XPM_COLORS
+ xpm_init_color_cache (f, &attrs);
+#endif
/* If image specification contains symbolic color definitions, add
these to `attrs'. */