diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b04f5451306..a4ff8d25fc6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -107,6 +107,11 @@ Lisp_Object Vframe_title_format; | |||
| 107 | /* Like mode-line-format, but for the titlebar on an iconified frame. */ | 107 | /* Like mode-line-format, but for the titlebar on an iconified frame. */ |
| 108 | Lisp_Object Vicon_title_format; | 108 | Lisp_Object Vicon_title_format; |
| 109 | 109 | ||
| 110 | /* List of functions to call when a window's size changes. These | ||
| 111 | functions get one arg, a frame on which one or more windows' sizes | ||
| 112 | have changed. */ | ||
| 113 | static Lisp_Object Vwindow_size_change_functions; | ||
| 114 | |||
| 110 | /* Values of those variables at last redisplay. */ | 115 | /* Values of those variables at last redisplay. */ |
| 111 | static Lisp_Object last_arrow_position, last_arrow_string; | 116 | static Lisp_Object last_arrow_position, last_arrow_string; |
| 112 | 117 | ||
| @@ -559,6 +564,7 @@ prepare_menu_bars () | |||
| 559 | { | 564 | { |
| 560 | register struct window *w = XWINDOW (selected_window); | 565 | register struct window *w = XWINDOW (selected_window); |
| 561 | int all_windows; | 566 | int all_windows; |
| 567 | struct gcpro gcpro1, gcpro2; | ||
| 562 | 568 | ||
| 563 | if (noninteractive) | 569 | if (noninteractive) |
| 564 | return; | 570 | return; |
| @@ -606,7 +612,26 @@ prepare_menu_bars () | |||
| 606 | Lisp_Object tail, frame; | 612 | Lisp_Object tail, frame; |
| 607 | 613 | ||
| 608 | FOR_EACH_FRAME (tail, frame) | 614 | FOR_EACH_FRAME (tail, frame) |
| 609 | update_menu_bar (XFRAME (frame)); | 615 | { |
| 616 | /* If a window on this frame changed size, | ||
| 617 | report that to the user and clear the size-change flag. */ | ||
| 618 | if (FRAME_WINDOW_SIZES_CHANGED (XFRAME (frame))) | ||
| 619 | { | ||
| 620 | Lisp_Object functions; | ||
| 621 | functions = Vwindow_size_change_functions; | ||
| 622 | GCPRO2 (tail, functions); | ||
| 623 | while (CONSP (functions)) | ||
| 624 | { | ||
| 625 | call1 (XCONS (functions)->car, frame); | ||
| 626 | functions = XCONS (functions)->cdr; | ||
| 627 | } | ||
| 628 | UNGCPRO; | ||
| 629 | FRAME_WINDOW_SIZES_CHANGED (XFRAME (frame)) = 0; | ||
| 630 | } | ||
| 631 | GCPRO1 (tail); | ||
| 632 | update_menu_bar (XFRAME (frame)); | ||
| 633 | UNGCPRO; | ||
| 634 | } | ||
| 610 | } | 635 | } |
| 611 | else | 636 | else |
| 612 | update_menu_bar (selected_frame); | 637 | update_menu_bar (selected_frame); |
| @@ -3769,6 +3794,14 @@ and is used only on frames for which no explicit name has been set\n\ | |||
| 3769 | If nil, disable message logging. If t, log messages but don't truncate\n\ | 3794 | If nil, disable message logging. If t, log messages but don't truncate\n\ |
| 3770 | the buffer when it becomes large."); | 3795 | the buffer when it becomes large."); |
| 3771 | XSETFASTINT (Vmessage_log_max, 50); | 3796 | XSETFASTINT (Vmessage_log_max, 50); |
| 3797 | |||
| 3798 | DEFVAR_LISP ("window-size-change-functions", &Vwindow_size_change_functions, | ||
| 3799 | "Functions called before redisplay, if window sizes have changed.\n\ | ||
| 3800 | The value should be a list of functions that take one argument.\n\ | ||
| 3801 | Just before redisplay, for each frame, if any of its windows have changed\n\ | ||
| 3802 | size since the last redisplay, or have been split or deleted,\n\ | ||
| 3803 | all the functions in the list are called, with the frame as argument."); | ||
| 3804 | Vwindow_size_change_functions = Qnil; | ||
| 3772 | } | 3805 | } |
| 3773 | 3806 | ||
| 3774 | /* initialize the window system */ | 3807 | /* initialize the window system */ |