diff options
| author | Martin Rudalics | 2014-11-08 12:11:50 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-11-08 12:11:50 +0100 |
| commit | c936cbbc830b194dbb1cd7ff039ea9978a7ab607 (patch) | |
| tree | 34398222a4e29fda5c2e26844b54ad7eea3d6351 /src/frame.c | |
| parent | a05fd1fc7813611575cad6890a45b5fd7eba8e67 (diff) | |
| download | emacs-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/frame.c')
| -rw-r--r-- | src/frame.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/frame.c b/src/frame.c index b03e207c105..c68195caba2 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -463,7 +463,7 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, | |||
| 463 | 463 | ||
| 464 | #ifdef HAVE_WINDOW_SYSTEM | 464 | #ifdef HAVE_WINDOW_SYSTEM |
| 465 | if (FRAME_WINDOW_P (f) | 465 | if (FRAME_WINDOW_P (f) |
| 466 | && f->official | 466 | && f->can_x_set_window_size |
| 467 | && ((!inhibit_horizontal | 467 | && ((!inhibit_horizontal |
| 468 | && (new_pixel_width != old_pixel_width | 468 | && (new_pixel_width != old_pixel_width |
| 469 | || inhibit == 0 || inhibit == 2)) | 469 | || inhibit == 0 || inhibit == 2)) |
| @@ -608,7 +608,8 @@ make_frame (bool mini_p) | |||
| 608 | f->wants_modeline = true; | 608 | f->wants_modeline = true; |
| 609 | f->redisplay = true; | 609 | f->redisplay = true; |
| 610 | f->garbaged = true; | 610 | f->garbaged = true; |
| 611 | f->official = false; | 611 | f->can_x_set_window_size = false; |
| 612 | f->can_run_window_configuration_change_hook = false; | ||
| 612 | f->column_width = 1; /* !FRAME_WINDOW_P value. */ | 613 | f->column_width = 1; /* !FRAME_WINDOW_P value. */ |
| 613 | f->line_height = 1; /* !FRAME_WINDOW_P value. */ | 614 | f->line_height = 1; /* !FRAME_WINDOW_P value. */ |
| 614 | #ifdef HAVE_WINDOW_SYSTEM | 615 | #ifdef HAVE_WINDOW_SYSTEM |
| @@ -2259,6 +2260,25 @@ If there is no window system support, this function does nothing. */) | |||
| 2259 | return Qnil; | 2260 | return Qnil; |
| 2260 | } | 2261 | } |
| 2261 | 2262 | ||
| 2263 | DEFUN ("frame-can-run-window-configuration-change-hook", | ||
| 2264 | Fcan_run_window_configuration_change_hook, | ||
| 2265 | Scan_run_window_configuration_change_hook, 2, 2, 0, | ||
| 2266 | doc: /* Whether `window-configuration-change-hook' is run for frame FRAME. | ||
| 2267 | FRAME nil means use the selected frame. Second argument ALLOW non-nil | ||
| 2268 | means functions on `window-configuration-change-hook' are called | ||
| 2269 | whenever the window configuration of FRAME changes. ALLOW nil means | ||
| 2270 | these functions are not called. | ||
| 2271 | |||
| 2272 | This function is currently called by `face-set-after-frame-default' only | ||
| 2273 | and should be otherwise used with utter care to avoid that running | ||
| 2274 | functions on `window-configuration-change-hook' is impeded forever. */) | ||
| 2275 | (Lisp_Object frame, Lisp_Object allow) | ||
| 2276 | { | ||
| 2277 | struct frame *f = decode_live_frame (frame); | ||
| 2278 | |||
| 2279 | f->can_run_window_configuration_change_hook = NILP (allow) ? false : true; | ||
| 2280 | } | ||
| 2281 | |||
| 2262 | 2282 | ||
| 2263 | /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ | 2283 | /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ |
| 2264 | 2284 | ||
| @@ -5083,6 +5103,7 @@ even if this option is non-nil. */); | |||
| 5083 | defsubr (&Sraise_frame); | 5103 | defsubr (&Sraise_frame); |
| 5084 | defsubr (&Slower_frame); | 5104 | defsubr (&Slower_frame); |
| 5085 | defsubr (&Sx_focus_frame); | 5105 | defsubr (&Sx_focus_frame); |
| 5106 | defsubr (&Scan_run_window_configuration_change_hook); | ||
| 5086 | defsubr (&Sredirect_frame_focus); | 5107 | defsubr (&Sredirect_frame_focus); |
| 5087 | defsubr (&Sframe_focus); | 5108 | defsubr (&Sframe_focus); |
| 5088 | defsubr (&Sframe_parameters); | 5109 | defsubr (&Sframe_parameters); |