aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMartin Rudalics2014-11-08 12:11:50 +0100
committerMartin Rudalics2014-11-08 12:11:50 +0100
commitc936cbbc830b194dbb1cd7ff039ea9978a7ab607 (patch)
tree34398222a4e29fda5c2e26844b54ad7eea3d6351 /src/window.c
parenta05fd1fc7813611575cad6890a45b5fd7eba8e67 (diff)
downloademacs-c936cbbc830b194dbb1cd7ff039ea9978a7ab607.tar.gz
emacs-c936cbbc830b194dbb1cd7ff039ea9978a7ab607.zip
Run `window-configuration-change-hook' only after all faces have been realized.
* 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. * faces.el (face-set-after-frame-default): Enable running `window-configuration-change-hook'.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index 168ef1e3b9d..e4ff2b41806 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3337,7 +3337,9 @@ run_window_configuration_change_hook (struct frame *f)
3337 = Fdefault_value (Qwindow_configuration_change_hook); 3337 = Fdefault_value (Qwindow_configuration_change_hook);
3338 XSETFRAME (frame, f); 3338 XSETFRAME (frame, f);
3339 3339
3340 if (NILP (Vrun_hooks) || !(f->official)) 3340 if (NILP (Vrun_hooks)
3341 || !(f->can_x_set_window_size)
3342 || !(f->can_run_window_configuration_change_hook))
3341 return; 3343 return;
3342 3344
3343 /* Use the right buffer. Matters when running the local hooks. */ 3345 /* Use the right buffer. Matters when running the local hooks. */
@@ -6204,8 +6206,8 @@ the return value is nil. Otherwise the value is t. */)
6204 call1 (Qrecord_window_buffer, window); 6206 call1 (Qrecord_window_buffer, window);
6205 } 6207 }
6206 6208
6207 /* Consider frame unofficial, temporarily. */ 6209 /* Disallow x_set_window_size, temporarily. */
6208 f->official = false; 6210 f->can_x_set_window_size = false;
6209 /* The mouse highlighting code could get screwed up 6211 /* The mouse highlighting code could get screwed up
6210 if it runs during this. */ 6212 if it runs during this. */
6211 block_input (); 6213 block_input ();
@@ -6414,9 +6416,9 @@ the return value is nil. Otherwise the value is t. */)
6414 ++n; 6416 ++n;
6415 } 6417 }
6416 6418
6417 /* Make frame official again and apply frame size changes if 6419 /* Allow x_set_window_size again and apply frame size changes if
6418 needed. */ 6420 needed. */
6419 f->official = true; 6421 f->can_x_set_window_size = true;
6420 adjust_frame_size (f, -1, -1, 1, 0, Qnil); 6422 adjust_frame_size (f, -1, -1, 1, 0, Qnil);
6421 6423
6422 adjust_frame_glyphs (f); 6424 adjust_frame_glyphs (f);