emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/frame.c,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/frame.c,v
Date: Tue, 20 Feb 2007 01:56:11 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/02/20 01:56:11

Index: frame.c
===================================================================
RCS file: /sources/emacs/emacs/src/frame.c,v
retrieving revision 1.339
retrieving revision 1.340
diff -u -b -r1.339 -r1.340
--- frame.c     16 Feb 2007 16:35:31 -0000      1.339
+++ frame.c     20 Feb 2007 01:56:11 -0000      1.340
@@ -3057,18 +3057,30 @@
      struct frame *f;
      Lisp_Object new_value, old_value;
 {
+  Lisp_Object bgcolor;
+
   if (NILP (new_value))
     f->gamma = 0;
   else if (NUMBERP (new_value) && XFLOATINT (new_value) > 0)
-    {
-      Fclear_face_cache (Qnil);
       /* The value 0.4545 is the normal viewing gamma.  */
       f->gamma = 1.0 / (0.4545 * XFLOATINT (new_value));
-    }
   else
     signal_error ("Invalid screen-gamma", new_value);
 
-  clear_face_cache (0);
+  /* Apply the new gamma value to the frame background.  */
+  bgcolor = Fassq (Qbackground_color, f->param_alist);
+  if (CONSP (bgcolor) && (bgcolor = XCDR (bgcolor), STRINGP (bgcolor)))
+    {
+      Lisp_Object index = Fget (Qbackground_color, Qx_frame_parameter);
+      if (NATNUMP (index)
+         && (XFASTINT (index)
+             < sizeof (frame_parms)/sizeof (frame_parms[0]))
+         && rif->frame_parm_handlers[XFASTINT (index)])
+       (*(rif->frame_parm_handlers[XFASTINT (index)]))
+         (f, bgcolor, Qnil);
+    }
+
+  Fclear_face_cache (Qnil);
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]