From 6a7d4ee3ae1d7c76b5b58cdfb28fdb0f461e7cda Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 24 Sep 2002 23:54:12 +0000 Subject: Look up the visual as well as the colormap, since calling Tue Sep 24 19:45:55 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_get_colormap): Look up the visual as well as the colormap, since calling gdk_drawable_get_visual() causes infinite recursion. * gdk/x11/gdkwindow-x11.c (_gdk_windowing_window_init): Set the colormap for the root window. --- gdk/x11/gdkwindow-x11.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gdk') diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index f76e71971a..c4368d7f6c 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -198,13 +198,16 @@ gdk_window_impl_x11_get_colormap (GdkDrawable *drawable) drawable_impl->colormap == NULL) { XWindowAttributes window_attributes; + GdkVisual *visual; XGetWindowAttributes (GDK_SCREEN_XDISPLAY (drawable_impl->screen), drawable_impl->xid, &window_attributes); - drawable_impl->colormap = - gdk_x11_colormap_foreign_new (gdk_drawable_get_visual (drawable), - window_attributes.colormap); + + visual = gdk_x11_screen_lookup_visual (drawable_impl->screen, + window_attributes.visual->visualid); + drawable_impl->colormap = gdk_x11_colormap_foreign_new (visual, + window_attributes.colormap); } return drawable_impl->colormap; @@ -302,9 +305,11 @@ _gdk_windowing_window_init (GdkScreen * screen) draw_impl->screen = screen; draw_impl->xid = screen_x11->xroot_window; draw_impl->wrapper = GDK_DRAWABLE (private); + draw_impl->colormap = gdk_screen_get_system_colormap (screen); private->window_type = GDK_WINDOW_ROOT; private->depth = depth; + impl->width = width; impl->height = height; -- cgit v1.2.1