]> code.delx.au - gnu-emacs/blobdiff - src/frame.c
Merged from emacs@sv.gnu.org
[gnu-emacs] / src / frame.c
index 6b848ea2fef67ae0c327dea472a96b07b477db83..04a663f93886b81ed43f9e81e3c3aa16c065b7ba 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic frame functions.
    Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
-                 2004, 2005 Free Software Foundation, Inc.
+                 2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -588,11 +588,11 @@ make_terminal_frame (struct terminal *terminal)
         for the black color.  Other frames all inherit their pixels
         from what's already in the_only_x_display.  */
       if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
-         && f->output_data.x->background_pixel == 0
-         && f->output_data.x->foreground_pixel == 0)
+         && FRAME_BACKGROUND_PIXEL (f) == 0
+         && FRAME_FOREGROUND_PIXEL (f) == 0)
        {
-         f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR;
-         f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR;
+         FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
+         FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
        }
     }
   else
@@ -766,9 +766,12 @@ affects all frames on the same terminal device.  */)
   Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
                                                  build_string (t->display_info.tty->type)),
                                           Qnil));
-  Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty,
-                                                 build_string (t->display_info.tty->name)),
-                                          Qnil));
+  if (t->display_info.tty->name != NULL)
+    Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty,
+                                                   build_string (t->display_info.tty->name)),
+                                            Qnil));
+  else
+    Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil));
   
   /* Make the frame face alist be frame-specific, so that each
      frame could change its face definitions independently.  */
@@ -2280,6 +2283,7 @@ store_frame_param (f, prop, val)
       if ((BUFFER_LOCAL_VALUEP (valcontents)
           || SOME_BUFFER_LOCAL_VALUEP (valcontents))
          && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
+         && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
          && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
        swap_in_global_binding (prop);
     }
@@ -3395,6 +3399,11 @@ x_set_font (f, arg, oldval)
       else if (!NILP (Fequal (result, oldval)))
         return;
 
+      /* Recalculate toolbar height.  */
+      f->n_tool_bar_rows = 0;
+      /* Ensure we redraw it.  */
+      clear_current_matrices (f);
+
       store_frame_param (f, Qfont, result);
       recompute_basic_faces (f);
     }
@@ -3819,8 +3828,27 @@ x_get_arg (dpyinfo, alist, param, attribute, class, type)
   register Lisp_Object tem;
 
   tem = Fassq (param, alist);
-  if (EQ (tem, Qnil))
+
+  if (!NILP (tem))
+    {
+      /* If we find this parm in ALIST, clear it out
+        so that it won't be "left over" at the end.  */
+#ifndef WINDOWSNT /* w32fns.c has not yet been changed to cope with this.  */
+      Lisp_Object tail;
+      XSETCAR (tem, Qnil);
+      /* In case the parameter appears more than once in the alist,
+        clear it out.  */
+      for (tail = alist; CONSP (tail); tail = XCDR (tail))
+       if (CONSP (XCAR (tail))
+           && EQ (XCAR (XCAR (tail)), param))
+         XSETCAR (XCAR (tail), Qnil);
+#endif
+    }
+  else
     tem = Fassq (param, Vdefault_frame_alist);
+
+  /* If it wasn't specified in ALIST or the Lisp-level defaults,
+     look in the X resources.  */
   if (EQ (tem, Qnil))
     {
       if (attribute)
@@ -3904,7 +3932,7 @@ x_frame_get_and_record_arg (f, alist, param, attribute, class, type)
 
   value = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param,
                     attribute, class, type);
-  if (! NILP (value))
+  if (! NILP (value) && ! EQ (value, Qunbound))
     store_frame_param (f, param, value);
 
   return value;
@@ -4350,6 +4378,7 @@ These may be set in your init file, like this:
 These override values given in window system configuration data,
  including X Windows' defaults database.
 For values specific to the first Emacs frame, see `initial-frame-alist'.
+For window-system specific values, see `window-system-default-frame-alist'.
 For values specific to the separate minibuffer frame, see
  `minibuffer-frame-alist'.
 The `menu-bar-lines' element of the list controls whether new frames