+2014-11-08 Martin Rudalics <rudalics@gmx.at>
+
+ * faces.el (face-set-after-frame-default): Enable running
+ `window-configuration-change-hook'.
+
2014-11-07 Juri Linkov <juri@jurta.org>
* replace.el: History for query replace pairs.
(value (cdr (assq param-name parameters))))
(if value
(set-face-attribute (nth 1 param) frame
- (nth 2 param) value))))))
+ (nth 2 param) value))))
+ (frame-can-run-window-configuration-change-hook frame t)))
(defun tty-handle-reverse-video (frame parameters)
"Handle the reverse-video frame parameter for terminal frames."
+2014-11-08 Martin Rudalics <rudalics@gmx.at>
+
+ * frame.c (adjust_frame_size): Call x_set_window_size only if
+ f->can_x_set_window_size is set.
+ (make_frame): Initialize f->can_x_set_window_size and
+ f->can_run_window_configuration_change_hook.
+ (Fcan_run_window_configuration_change_hook): New function.
+ * frame.h (frame): Split `official' into `can_x_set_window_size'
+ and `can_run_window_configuration_change_hook'.
+ * nsfns.m (Fx_create_frame): Set f->can_x_set_window_size.
+ * w32fns.c (Fx_create_frame, x_create_tip_frame): Set
+ f->can_x_set_window_size.
+ * window.c (run_window_configuration_change_hook): Return
+ immediately if either f->can_x_set_window_size or
+ f->can_run_window_configuration_change_hook are false.
+ (Fset_window_configuration): Instead of f->official set
+ f->can_x_set_window_size.
+ * xfns.c (Fx_create_frame, x_create_tip_frame): Set
+ f->can_x_set_window_size.
+
2014-11-08 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (EmacsScroller.dealloc): Reinstate, removed at merge
#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 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;
+}
+
\f
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
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);
in pixels. */
bool_bf new_pixelwise : 1;
- /* True if frame has been added to Vframe_list and is henceforth
- considered official. For in-official frames we neither process
- x_set_window_size requests nor do we allow running
- window-configuration-change-hook when resizing windows. */
- bool_bf official : 1;
+ /* True means x_set_window_size requests can be processed for this
+ frame. */
+ bool_bf can_x_set_window_size : 1;
+
+ /* True means run_window_configuration_change_hook can be processed
+ for this frame. */
+ bool_bf can_run_window_configuration_change_hook : 1;
/* Bitfield area ends here. */
x_default_parameter (f, parms, Qfullscreen, Qnil,
"fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
- /* Consider frame official, now. */
- f->official = true;
+ /* Allow x_set_window_size, now. */
+ f->can_x_set_window_size = true;
adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1, Qnil);
x_default_parameter (f, parameters, Qscroll_bar_height, Qnil,
"scrollBarHeight", "ScrollBarHeight", RES_TYPE_NUMBER);
- /* Consider frame official, now. */
- f->official = true;
+ /* Allow x_set_window_size, now. */
+ f->can_x_set_window_size = true;
adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1, Qnil);
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- f->official = true;
+ f->can_x_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
and similar will increment face_change_count, which leads to the
= Fdefault_value (Qwindow_configuration_change_hook);
XSETFRAME (frame, f);
- if (NILP (Vrun_hooks) || !(f->official))
+ if (NILP (Vrun_hooks)
+ || !(f->can_x_set_window_size)
+ || !(f->can_run_window_configuration_change_hook))
return;
/* Use the right buffer. Matters when running the local hooks. */
call1 (Qrecord_window_buffer, window);
}
- /* Consider frame unofficial, temporarily. */
- f->official = false;
+ /* Disallow x_set_window_size, temporarily. */
+ f->can_x_set_window_size = false;
/* The mouse highlighting code could get screwed up
if it runs during this. */
block_input ();
++n;
}
- /* Make frame official again and apply frame size changes if
+ /* Allow x_set_window_size again and apply frame size changes if
needed. */
- f->official = true;
+ f->can_x_set_window_size = true;
adjust_frame_size (f, -1, -1, 1, 0, Qnil);
adjust_frame_glyphs (f);
"alpha", "Alpha", RES_TYPE_NUMBER);
/* Consider frame official, now. */
- f->official = true;
+ f->can_x_set_window_size = true;
adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1, Qnil);
below. And the frame needs to be on Vframe_list or making it
visible won't work. */
Vframe_list = Fcons (frame, Vframe_list);
- f->official = true;
+ f->can_x_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
and similar will increment face_change_count, which leads to the