From: Gerd Moellmann Date: Sun, 5 Mar 2000 10:23:14 +0000 (+0000) Subject: (x_term_init): Create a colormap if not using the X-Git-Tag: emacs-pretest-21.0.90~4769 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ff67d81bc2162b5901a09e3a3507f96ffa72096;p=emacs.git (x_term_init): Create a colormap if not using the default visual. --- diff --git a/src/xterm.c b/src/xterm.c index 82e3cc308dd..26d87fe3b4e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12988,8 +12988,7 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->screen = ScreenOfDisplay (dpyinfo->display, DefaultScreen (dpyinfo->display)); - dpyinfo->visual = select_visual (dpyinfo->display, dpyinfo->screen, - &dpyinfo->n_planes); + select_visual (dpyinfo); dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen); dpyinfo->height = HeightOfScreen (dpyinfo->screen); dpyinfo->width = WidthOfScreen (dpyinfo->screen); @@ -13018,19 +13017,24 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->image_cache = make_image_cache (); /* See if a private colormap is requested. */ - if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen) - && dpyinfo->visual->class == PseudoColor) - { - Lisp_Object value; - value = display_x_get_resource (dpyinfo, - build_string ("privateColormap"), - build_string ("PrivateColormap"), - Qnil, Qnil); - if (STRINGP (value) - && (!strcmp (XSTRING (value)->data, "true") - || !strcmp (XSTRING (value)->data, "on"))) - dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); + if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) + { + if (dpyinfo->visual->class == PseudoColor) + { + Lisp_Object value; + value = display_x_get_resource (dpyinfo, + build_string ("privateColormap"), + build_string ("PrivateColormap"), + Qnil, Qnil); + if (STRINGP (value) + && (!strcmp (XSTRING (value)->data, "true") + || !strcmp (XSTRING (value)->data, "on"))) + dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); + } } + else + dpyinfo->cmap = XCreateColormap (dpyinfo->display, dpyinfo->root_window, + dpyinfo->visual, AllocNone); { int screen_number = XScreenNumberOfScreen (dpyinfo->screen);