Fix last fix of note_mouse_highlight
[bpt/emacs.git] / src / frame.c
index df41822..703c67a 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic frame functions.
 
-Copyright (C) 1993-1995, 1997, 1999-2013 Free Software Foundation, Inc.
+Copyright (C) 1993-1995, 1997, 1999-2014 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1372,10 +1372,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
 
 
   {
+    struct terminal *terminal;
     block_input ();
     if (FRAME_TERMINAL (f)->delete_frame_hook)
       (*FRAME_TERMINAL (f)->delete_frame_hook) (f);
-    struct terminal *terminal = FRAME_TERMINAL (f);
+    terminal = FRAME_TERMINAL (f);
     f->output_data.nothing = 0;
     f->terminal = 0;             /* Now the frame is dead.  */
     unblock_input ();
@@ -1929,7 +1930,7 @@ If there is no window system support, this function does nothing.  */)
 /* Return the value of frame parameter PROP in frame FRAME.  */
 
 #ifdef HAVE_WINDOW_SYSTEM
-#if !HAVE_NS && !defined (WINDOWSNT)
+#if !HAVE_NS && !HAVE_NTGUI
 static
 #endif
 Lisp_Object
@@ -2027,6 +2028,7 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
   update_mode_lines = 16;
 }
 
+#ifdef HAVE_NTGUI
 void
 set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
 {
@@ -2038,6 +2040,7 @@ set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
   else
     Fsetcdr (old_alist_elt, val);
 }
+#endif
 
 void
 store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
@@ -2513,7 +2516,7 @@ DEFUN ("frame-scroll-bar-width", Fscroll_bar_width, Sscroll_bar_width, 0, 1, 0,
        doc: /* Return scroll bar width of FRAME in pixels.  */)
   (Lisp_Object frame)
 {
-  return make_number (decode_any_frame (frame)->scroll_bar_actual_width);
+  return make_number (FRAME_SCROLL_BAR_AREA_WIDTH (decode_any_frame (frame)));
 }
 
 DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0,
@@ -2805,7 +2808,9 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
   Lisp_Object *values;
   ptrdiff_t i, p;
   bool left_no_change = 0, top_no_change = 0;
+#ifdef HAVE_X_WINDOWS
   bool icon_left_no_change = 0, icon_top_no_change = 0;
+#endif
   bool size_changed = 0;
   struct gcpro gcpro1, gcpro2;
 
@@ -2952,14 +2957,18 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
   /* If one of the icon positions was not set, preserve or default it.  */
   if (! TYPE_RANGED_INTEGERP (int, icon_left))
     {
+#ifdef HAVE_X_WINDOWS
       icon_left_no_change = 1;
+#endif
       icon_left = Fcdr (Fassq (Qicon_left, f->param_alist));
       if (NILP (icon_left))
        XSETINT (icon_left, 0);
     }
   if (! TYPE_RANGED_INTEGERP (int, icon_top))
     {
+#ifdef HAVE_X_WINDOWS
       icon_top_no_change = 1;
+#endif
       icon_top = Fcdr (Fassq (Qicon_top, f->param_alist));
       if (NILP (icon_top))
        XSETINT (icon_top, 0);
@@ -3312,9 +3321,13 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 #endif
   /* Recalculate toolbar height.  */
   f->n_tool_bar_rows = 0;
+
   /* Ensure we redraw it.  */
   clear_current_matrices (f);
 
+  /* Attempt to hunt down bug#16028.  */
+  SET_FRAME_GARBAGED (f);
+
   recompute_basic_faces (f);
 
   do_pending_window_change (0);
@@ -3572,6 +3585,8 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
       do_pending_window_change (0);
     }
 
+  /* Eventually remove the following call.  It should have been done by
+     x_set_window_size already.  */
   change_frame_size (f, 0, 0, 0, 0, 0, 1);
   XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0;
   XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0;
@@ -4225,8 +4240,6 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
        window_prompting |= PSize;
     }
 
-  f->scroll_bar_actual_width
-    = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
 
   /* This used to be done _before_ calling x_figure_window_size, but
      since the height is reset here, this was really a no-op.  I
@@ -4696,7 +4709,6 @@ or call the function `tool-bar-mode'.  */);
 
   DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
                 doc: /* Minibufferless frames use this frame's minibuffer.
-
 Emacs cannot create minibufferless frames unless this is set to an
 appropriate surrogate.
 
@@ -4717,9 +4729,15 @@ automatically.  See also `mouse-autoselect-window'.  */);
   focus_follows_mouse = 0;
 
   DEFVAR_BOOL ("frame-resize-pixelwise", frame_resize_pixelwise,
-              doc: /* Non-nil means frames are resized pixelwise.
-If this is nil, resizing a frame will round sizes to the frame's
-current values of `frame-char-height' and `frame-char-width'.  */);
+              doc: /* Non-nil means resize frames pixelwise.
+If this option is nil, resizing a frame rounds its sizes to the frame's
+current values of `frame-char-height' and `frame-char-width'.  If this
+is non-nil, no rounding occurs, hence frame sizes can increase/decrease
+by one pixel.
+
+With some window managers you have to set this to non-nil in order to
+fully maximize frames.  The default of this option is nil.  To resize
+your initial frame pixelwise, set this option in your init file.  */);
   frame_resize_pixelwise = 0;
 
   staticpro (&Vframe_list);