diff options
| author | Martin Rudalics | 2019-02-02 09:43:34 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2019-02-02 09:43:34 +0100 |
| commit | dc1d2d3c22ab91b8b52188574680a028851fbda8 (patch) | |
| tree | 1b77668b8b5f0eba7ce1ce07ad5f7f7ea4098c7d /src | |
| parent | c0052dd43dc1c4a7a68e6b26edf6cd30d926373a (diff) | |
| download | emacs-dc1d2d3c22ab91b8b52188574680a028851fbda8.tar.gz emacs-dc1d2d3c22ab91b8b52188574680a028851fbda8.zip | |
Fix bugs caused by running window change functions during redisplay
* src/xdisp.c (redisplay_internal): Run window change
functions before updating the display so changes induced by
these functions can get caught by redisplay (Bug#34138).
* src/window.c (run_window_change_functions): Bind
Qinhibit_redisplay to avoid that the minibuffer window gets
resized while running window change functions (Bug#34179,
Bug#34260).
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 27 |
2 files changed, 4 insertions, 24 deletions
diff --git a/src/window.c b/src/window.c index 1b474a663a4..49d7fc2426b 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3710,6 +3710,7 @@ run_window_change_functions (void) | |||
| 3710 | ptrdiff_t count_outer = SPECPDL_INDEX (); | 3710 | ptrdiff_t count_outer = SPECPDL_INDEX (); |
| 3711 | 3711 | ||
| 3712 | record_unwind_protect_void (window_change_record); | 3712 | record_unwind_protect_void (window_change_record); |
| 3713 | specbind (Qinhibit_redisplay, Qt); | ||
| 3713 | 3714 | ||
| 3714 | FOR_EACH_FRAME (tail, frame) | 3715 | FOR_EACH_FRAME (tail, frame) |
| 3715 | { | 3716 | { |
diff --git a/src/xdisp.c b/src/xdisp.c index ec8dd862302..b5034b513e6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -14153,6 +14153,9 @@ redisplay_internal (void) | |||
| 14153 | clear_garbaged_frames (); | 14153 | clear_garbaged_frames (); |
| 14154 | } | 14154 | } |
| 14155 | 14155 | ||
| 14156 | if (!NILP (Vrun_hooks)) | ||
| 14157 | run_window_change_functions (); | ||
| 14158 | |||
| 14156 | if (windows_or_buffers_changed && !update_mode_lines) | 14159 | if (windows_or_buffers_changed && !update_mode_lines) |
| 14157 | /* Code that sets windows_or_buffers_changed doesn't distinguish whether | 14160 | /* Code that sets windows_or_buffers_changed doesn't distinguish whether |
| 14158 | only the windows's contents needs to be refreshed, or whether the | 14161 | only the windows's contents needs to be refreshed, or whether the |
| @@ -14332,18 +14335,6 @@ redisplay_internal (void) | |||
| 14332 | && (w = XWINDOW (selected_window)) != sw) | 14335 | && (w = XWINDOW (selected_window)) != sw) |
| 14333 | goto retry; | 14336 | goto retry; |
| 14334 | 14337 | ||
| 14335 | if (!NILP (Vrun_hooks)) | ||
| 14336 | { | ||
| 14337 | run_window_change_functions (); | ||
| 14338 | |||
| 14339 | /* If windows or buffers changed or selected_window | ||
| 14340 | changed, redisplay again. */ | ||
| 14341 | if ((windows_or_buffers_changed) | ||
| 14342 | || (WINDOWP (selected_window) | ||
| 14343 | && (w = XWINDOW (selected_window)) != sw)) | ||
| 14344 | goto retry; | ||
| 14345 | } | ||
| 14346 | |||
| 14347 | /* We used to always goto end_of_redisplay here, but this | 14338 | /* We used to always goto end_of_redisplay here, but this |
| 14348 | isn't enough if we have a blinking cursor. */ | 14339 | isn't enough if we have a blinking cursor. */ |
| 14349 | if (w->cursor_off_p == w->last_cursor_off_p) | 14340 | if (w->cursor_off_p == w->last_cursor_off_p) |
| @@ -14707,18 +14698,6 @@ redisplay_internal (void) | |||
| 14707 | && (w = XWINDOW (selected_window)) != sw)) | 14698 | && (w = XWINDOW (selected_window)) != sw)) |
| 14708 | goto retry; | 14699 | goto retry; |
| 14709 | 14700 | ||
| 14710 | if (!NILP (Vrun_hooks)) | ||
| 14711 | { | ||
| 14712 | run_window_change_functions (); | ||
| 14713 | |||
| 14714 | /* If windows or buffers changed or selected_window changed, | ||
| 14715 | redisplay again. */ | ||
| 14716 | if ((windows_or_buffers_changed) | ||
| 14717 | || (WINDOWP (selected_window) | ||
| 14718 | && (w = XWINDOW (selected_window)) != sw)) | ||
| 14719 | goto retry; | ||
| 14720 | } | ||
| 14721 | |||
| 14722 | /* Clear the face and image caches. | 14701 | /* Clear the face and image caches. |
| 14723 | 14702 | ||
| 14724 | We used to do this only if consider_all_windows_p. But the cache | 14703 | We used to do this only if consider_all_windows_p. But the cache |