]> code.delx.au - gnu-emacs/blobdiff - src/frame.c
Merged from emacs@sv.gnu.org
[gnu-emacs] / src / frame.c
index 7d5bdcb1cb6f1bff8b21885d6a6984867decdc42..48cca967cc1b4b97b600e378c218e91b702b72aa 100644 (file)
@@ -72,7 +72,6 @@ Lisp_Object Qx, Qw32, Qmac, Qpc;
 Lisp_Object Qvisible;
 Lisp_Object Qdisplay_type;
 Lisp_Object Qbackground_mode;
-Lisp_Object Qinhibit_default_face_x_resources;
 
 Lisp_Object Qx_frame_parameter;
 Lisp_Object Qx_resource_name;
@@ -2342,6 +2341,8 @@ store_frame_param (f, prop, val)
       /* Install the chosen minibuffer window, with proper buffer.  */
       f->minibuffer_window = val;
     }
+
+  return Qnil;
 }
 
 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
@@ -2539,15 +2540,6 @@ enabled such bindings for that variable with `make-variable-frame-local'.  */)
 {
   FRAME_PTR f;
   register Lisp_Object tail, prop, val;
-  int count = SPECPDL_INDEX ();
-
-  /* Bind this to t to inhibit initialization of the default face from
-     X resources in face-set-after-frame-default.  If we don't inhibit
-     this, modifying the `font' frame parameter, for example, while
-     there is a `default.attributeFont' X resource, won't work,
-     because `default's font is reset to the value of the X resource
-     and that resets the `font' frame parameter.  */
-  specbind (Qinhibit_default_face_x_resources, Qt);
 
   if (EQ (frame, Qnil))
     frame = selected_frame;
@@ -2601,8 +2593,6 @@ enabled such bindings for that variable with `make-variable-frame-local'.  */)
            call1 (Qframe_set_background_mode, frame);
        }
     }
-
-  return unbind_to (count, Qnil);
 }
 
 DEFUN ("frame-with-environment", Fframe_with_environment, Sframe_with_environment, 0, 1, 0,
@@ -3373,6 +3363,8 @@ x_set_screen_gamma (f, new_value, old_value)
      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)
@@ -3381,7 +3373,20 @@ x_set_screen_gamma (f, new_value, old_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);
 }
 
 
@@ -4424,10 +4429,6 @@ Setting this variable does not affect existing frames, only new ones.  */);
   Vdefault_frame_scroll_bars = Qnil;
 #endif
 
-  Qinhibit_default_face_x_resources
-    = intern ("inhibit-default-face-x-resources");
-  staticpro (&Qinhibit_default_face_x_resources);
-
   DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
                doc: /* The initial frame-object, which represents Emacs's stdout.  */);