diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 3af5ea49ab6..1a27c4c3c96 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13528,6 +13528,12 @@ redisplay_internal (void) | |||
| 13528 | bool polling_stopped_here = false; | 13528 | bool polling_stopped_here = false; |
| 13529 | Lisp_Object tail, frame; | 13529 | Lisp_Object tail, frame; |
| 13530 | 13530 | ||
| 13531 | /* Set a limit to the number of retries we perform due to horizontal | ||
| 13532 | scrolling, this avoids getting stuck in an uninterruptible | ||
| 13533 | infinite loop (Bug #24633). */ | ||
| 13534 | enum { MAX_HSCROLL_RETRIES = 16 }; | ||
| 13535 | int hscroll_retries = 0; | ||
| 13536 | |||
| 13531 | /* True means redisplay has to consider all windows on all | 13537 | /* True means redisplay has to consider all windows on all |
| 13532 | frames. False, only selected_window is considered. */ | 13538 | frames. False, only selected_window is considered. */ |
| 13533 | bool consider_all_windows_p; | 13539 | bool consider_all_windows_p; |
| @@ -14044,8 +14050,12 @@ redisplay_internal (void) | |||
| 14044 | if (!f->already_hscrolled_p) | 14050 | if (!f->already_hscrolled_p) |
| 14045 | { | 14051 | { |
| 14046 | f->already_hscrolled_p = true; | 14052 | f->already_hscrolled_p = true; |
| 14047 | if (hscroll_windows (f->root_window)) | 14053 | if (hscroll_retries <= MAX_HSCROLL_RETRIES |
| 14048 | goto retry_frame; | 14054 | && hscroll_windows (f->root_window)) |
| 14055 | { | ||
| 14056 | hscroll_retries++; | ||
| 14057 | goto retry_frame; | ||
| 14058 | } | ||
| 14049 | } | 14059 | } |
| 14050 | 14060 | ||
| 14051 | /* If the frame's redisplay flag was not set before | 14061 | /* If the frame's redisplay flag was not set before |
| @@ -14143,8 +14153,12 @@ redisplay_internal (void) | |||
| 14143 | 14153 | ||
| 14144 | if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf)) | 14154 | if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf)) |
| 14145 | { | 14155 | { |
| 14146 | if (hscroll_windows (selected_window)) | 14156 | if (hscroll_retries <= MAX_HSCROLL_RETRIES |
| 14147 | goto retry; | 14157 | && hscroll_windows (selected_window)) |
| 14158 | { | ||
| 14159 | hscroll_retries++; | ||
| 14160 | goto retry; | ||
| 14161 | } | ||
| 14148 | 14162 | ||
| 14149 | XWINDOW (selected_window)->must_be_updated_p = true; | 14163 | XWINDOW (selected_window)->must_be_updated_p = true; |
| 14150 | pending = update_frame (sf, false, false); | 14164 | pending = update_frame (sf, false, false); |
| @@ -14164,8 +14178,12 @@ redisplay_internal (void) | |||
| 14164 | XWINDOW (mini_window)->must_be_updated_p = true; | 14178 | XWINDOW (mini_window)->must_be_updated_p = true; |
| 14165 | pending |= update_frame (mini_frame, false, false); | 14179 | pending |= update_frame (mini_frame, false, false); |
| 14166 | mini_frame->cursor_type_changed = false; | 14180 | mini_frame->cursor_type_changed = false; |
| 14167 | if (!pending && hscroll_windows (mini_window)) | 14181 | if (!pending && hscroll_retries <= MAX_HSCROLL_RETRIES |
| 14168 | goto retry; | 14182 | && hscroll_windows (mini_window)) |
| 14183 | { | ||
| 14184 | hscroll_retries++; | ||
| 14185 | goto retry; | ||
| 14186 | } | ||
| 14169 | } | 14187 | } |
| 14170 | } | 14188 | } |
| 14171 | 14189 | ||