changeset 85286:32990bd9ba7b

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:46:11 +0000
parents 0d4843543e8b
children 4fcb97418117
files src/xfns.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Sat Oct 13 23:48:41 2007 +0000
+++ b/src/xfns.c	Sun Oct 14 02:46:11 2007 +0000
@@ -4947,6 +4947,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.