/* Generic frame functions.
-Copyright (C) 1993-1995, 1997, 1999-2014 Free Software Foundation, Inc.
+Copyright (C) 1993-1995, 1997, 1999-2015 Free Software Foundation, Inc.
This file is part of GNU Emacs.
}
static int
-frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object pixelwise)
+frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise)
{
- return XINT (call3 (Qframe_windows_min_size, frame, horizontal, pixelwise));
+ return XINT (call4 (Qframe_windows_min_size, frame, horizontal, ignore, pixelwise));
}
/* The following two values are calculated from the old window body
sizes and any "new" settings for scroll bars, dividers, fringes and
margins (though the latter should have been processed already). */
- min_windows_width = frame_windows_min_size (frame, Qt, Qt);
- min_windows_height = frame_windows_min_size (frame, Qnil, Qt);
+ min_windows_width
+ = frame_windows_min_size (frame, Qt, (inhibit == 5) ? Qt : Qnil, Qt);
+ min_windows_height
+ = frame_windows_min_size (frame, Qnil, (inhibit == 5) ? Qt : Qnil, Qt);
if (inhibit >= 2 && inhibit <= 4)
/* If INHIBIT is in [2..4] inhibit if the "old" window sizes stay
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f)
- && f->official
+ && f->can_x_set_window_size
&& ((!inhibit_horizontal
&& (new_pixel_width != old_pixel_width
|| inhibit == 0 || inhibit == 2))
f->wants_modeline = true;
f->redisplay = true;
f->garbaged = true;
- f->official = false;
+ f->can_x_set_window_size = false;
+ f->can_run_window_configuration_change_hook = false;
f->column_width = 1; /* !FRAME_WINDOW_P value. */
f->line_height = 1; /* !FRAME_WINDOW_P value. */
#ifdef HAVE_WINDOW_SYSTEM
return do_switch_frame (frame, 1, 0, norecord);
}
-DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e",
+DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "^e",
doc: /* Handle a switch-frame event EVENT.
Switch-frame events are usually bound to this function.
A switch-frame event tells Emacs that the window manager has requested
return Qnil;
}
+DEFUN ("frame-can-run-window-configuration-change-hook",
+ Fcan_run_window_configuration_change_hook,
+ Scan_run_window_configuration_change_hook, 2, 2, 0,
+ doc: /* Whether `window-configuration-change-hook' is run for frame FRAME.
+FRAME nil means use the selected frame. Second argument ALLOW non-nil
+means functions on `window-configuration-change-hook' are called
+whenever the window configuration of FRAME changes. ALLOW nil means
+these functions are not called.
+
+This function is currently called by `face-set-after-frame-default' only
+and should be otherwise used with utter care to avoid that running
+functions on `window-configuration-change-hook' is impeded forever. */)
+ (Lisp_Object frame, Lisp_Object allow)
+{
+ struct frame *f = decode_live_frame (frame);
+
+ f->can_run_window_configuration_change_hook = NILP (allow) ? false : true;
+ return Qnil;
+}
+
\f
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
/* Start with emacs.FRAMENAME for the name (the specific one)
and with `Emacs' for the class key (the general one). */
- lispstpcpy (name_key, Vx_resource_name);
- lispstpcpy (class_key, Vx_resource_class);
+ char *nz = lispstpcpy (name_key, Vx_resource_name);
+ char *cz = lispstpcpy (class_key, Vx_resource_class);
- strcat (class_key, ".");
- strcat (class_key, SSDATA (class));
+ *cz++ = '.';
+ cz = lispstpcpy (cz, class);
if (!NILP (component))
{
- strcat (class_key, ".");
- strcat (class_key, SSDATA (subclass));
+ *cz++ = '.';
+ lispstpcpy (cz, subclass);
- strcat (name_key, ".");
- strcat (name_key, SSDATA (component));
+ *nz++ = '.';
+ nz = lispstpcpy (nz, component);
}
- strcat (name_key, ".");
- strcat (name_key, SSDATA (attribute));
+ *nz++ = '.';
+ lispstpcpy (nz, attribute);
char *value = x_get_string_resource (rdb, name_key, class_key);
SAFE_FREE();
`vertical-scroll-bars'.
The default value is '(tool-bar-lines) on Lucid, Motif and Windows
-(which means that adding/removing a tool bar does not change the frame
+\(which means that adding/removing a tool bar does not change the frame
height), nil on all other window systems including GTK+ (which means
that changing any of the parameters listed above may change the size of
the frame), and `t' otherwise (which means the frame size never changes
defsubr (&Sraise_frame);
defsubr (&Slower_frame);
defsubr (&Sx_focus_frame);
+ defsubr (&Scan_run_window_configuration_change_hook);
defsubr (&Sredirect_frame_focus);
defsubr (&Sframe_focus);
defsubr (&Sframe_parameters);