diff src/xfns.c @ 79076:9dd45fcaa2f0

John Paul Wallington <jpw at pobox.com> (x_create_tip_frame): Set the `display-type' frame parameter before setting up faces.
author Glenn Morris <rgm@gnu.org>
date Sun, 14 Oct 2007 02:45:48 +0000
parents 3d1946da128d
children 1e0460efd25e
line wrap: on
line diff
--- a/src/xfns.c	Sat Oct 13 20:20:14 2007 +0000
+++ b/src/xfns.c	Sun Oct 14 02:45:48 2007 +0000
@@ -4927,6 +4927,23 @@
     Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
 					    Qnil));
 
+  /* Set the `display-type' frame parameter before setting up faces. */
+  {
+    Lisp_Object disptype;
+
+    if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
+      disptype = intern ("mono");
+    else if (FRAME_X_DISPLAY_INFO (f)->visual->class == GrayScale ||
+             FRAME_X_DISPLAY_INFO (f)->visual->class == StaticGray)
+      disptype = intern ("grayscale");
+    else
+      disptype = intern ("color");
+
+    if (NILP (Fframe_parameter (frame, Qdisplay_type)))
+      Fmodify_frame_parameters (frame, Fcons (Fcons (Qdisplay_type, disptype),
+                                              Qnil));
+  }
+
   /* Set up faces after all frame parameters are known.  This call
      also merges in face attributes specified for new frames.