diff options
author | Ron Steinke <rsteinke@src.gnome.org> | 2001-07-23 21:28:38 +0000 |
---|---|---|
committer | Ron Steinke <rsteinke@src.gnome.org> | 2001-07-23 21:28:38 +0000 |
commit | 9cfd92ef66b4c3661cd9dee8d6f91de8a1ef7a17 (patch) | |
tree | fea195cb232164439b1db9d1b96d2c491ff7a55f /gdk/x11/gdkpixmap-x11.c | |
parent | 5f50d1fd7297e1851630c7e53d60b997a5b95125 (diff) | |
download | gtk+-9cfd92ef66b4c3661cd9dee8d6f91de8a1ef7a17.tar.gz |
Added a check on the colormap depth to gdk_drawable_set_colormap()
* gdk/gdkdraw.c: Added a check on the colormap depth to
gdk_drawable_set_colormap()
* gdk/x11/gdkimage-x11.c: combination of Mathias Hasselmann's
patch to fix colorsel and my patch to fix gdk_drawable_get_image()
for pixmaps without visuals (more specifically, bitmaps)
* gdk/x11/gdkpixmap-x11.c: Fixed gdk_pixmap_new() so it
doesn't set a colormap with the wrong depth
Diffstat (limited to 'gdk/x11/gdkpixmap-x11.c')
-rw-r--r-- | gdk/x11/gdkpixmap-x11.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index 03ef5888cf..fe0b421a0c 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -150,6 +150,7 @@ gdk_pixmap_new (GdkWindow *window, GdkDrawableImplX11 *draw_impl; GdkPixmapImplX11 *pix_impl; GdkColormap *cmap; + gint window_depth; g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); @@ -161,8 +162,9 @@ gdk_pixmap_new (GdkWindow *window, if (GDK_WINDOW_DESTROYED (window)) return NULL; + window_depth = gdk_drawable_get_depth (GDK_DRAWABLE (window)); if (depth == -1) - depth = gdk_drawable_get_depth (GDK_DRAWABLE (window)); + depth = window_depth; pixmap = g_object_new (gdk_pixmap_get_type (), NULL); draw_impl = GDK_DRAWABLE_IMPL_X11 (GDK_PIXMAP_OBJECT (pixmap)->impl); @@ -179,7 +181,7 @@ gdk_pixmap_new (GdkWindow *window, pix_impl->height = height; GDK_PIXMAP_OBJECT (pixmap)->depth = depth; - if (window) + if (depth == window_depth) { cmap = gdk_drawable_get_colormap (window); if (cmap) |