changeset 27985:4ba445af210b

(x_term_init): Set Colormap member of x_display_info structure. Copy colormap if resource `privateColormap' is specified (PseudoColor only). (x_setup_relief_color): Access colormap of frame using FRAME_X_COLORMAP.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 04 Mar 2000 16:00:03 +0000
parents 574e0b398168
children 8cc3bff16c28
files src/xterm.c
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Sat Mar 04 15:58:49 2000 +0000
+++ b/src/xterm.c	Sat Mar 04 16:00:03 2000 +0000
@@ -3351,7 +3351,7 @@
   unsigned long mask = GCForeground | GCLineWidth | GCGraphicsExposures;
   unsigned long pixel;
   unsigned long background = di->relief_background;
-  Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f));
+  Colormap cmap = FRAME_X_COLORMAP (f);
   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   Display *dpy = FRAME_X_DISPLAY (f);
 
@@ -12990,6 +12990,7 @@
 				     DefaultScreen (dpyinfo->display));
   dpyinfo->visual = select_visual (dpyinfo->display, dpyinfo->screen,
 				   &dpyinfo->n_planes);
+  dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen);
   dpyinfo->height = HeightOfScreen (dpyinfo->screen);
   dpyinfo->width = WidthOfScreen (dpyinfo->screen);
   dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen);
@@ -13016,6 +13017,21 @@
   dpyinfo->x_highlight_frame = 0;
   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);
+    }
+      
   {
     int screen_number = XScreenNumberOfScreen (dpyinfo->screen);
     double pixels = DisplayHeight (dpyinfo->display, screen_number);