diff src/faces.c @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents c9fe270a4101
children afd57c14dfc8
line wrap: on
line diff
--- a/src/faces.c	Mon Aug 13 10:38:47 2007 +0200
+++ b/src/faces.c	Mon Aug 13 10:39:40 2007 +0200
@@ -1944,6 +1944,27 @@
 				  build_string ("gui element face"),
 				  Qnil);
 
+  /* Provide some last-resort fallbacks for gui-element face which
+     mustn't default to default. */
+  {
+    Lisp_Object fg_fb = Qnil, bg_fb = Qnil;
+
+#ifdef HAVE_X_WINDOWS
+    fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb);
+    bg_fb = acons (list1 (Qx), build_string ("Gray80"), bg_fb);
+#endif
+#ifdef HAVE_TTY
+    fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb);
+    bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb);
+#endif
+#ifdef HAVE_MS_WINDOWS
+    fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb);
+    bg_fb = acons (list1 (Qmswindows), build_string ("Gray75"), bg_fb);
+#endif
+    set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil), fg_fb);
+    set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil), bg_fb);
+  }
+
   /* Now create the other faces that redisplay needs to refer to
      directly.  We could create them in Lisp but it's simpler this
      way since we need to get them anyway. */