bool polling_stopped_here = false;
Lisp_Object tail, frame;
+ /* Set a limit to the number of retries we perform due to horizontal
+ scrolling, this avoids getting stuck in an uninterruptible
+ infinite loop (Bug #24633). */
+ enum { MAX_HSCROLL_RETRIES = 16 };
+ int hscroll_retries = 0;
+
/* True means redisplay has to consider all windows on all
frames. False, only selected_window is considered. */
bool consider_all_windows_p;
if (!f->already_hscrolled_p)
{
f->already_hscrolled_p = true;
- if (hscroll_windows (f->root_window))
- goto retry_frame;
+ if (hscroll_retries <= MAX_HSCROLL_RETRIES
+ && hscroll_windows (f->root_window))
+ {
+ hscroll_retries++;
+ goto retry_frame;
+ }
}
/* If the frame's redisplay flag was not set before
if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
{
- if (hscroll_windows (selected_window))
- goto retry;
+ if (hscroll_retries <= MAX_HSCROLL_RETRIES
+ && hscroll_windows (selected_window))
+ {
+ hscroll_retries++;
+ goto retry;
+ }
XWINDOW (selected_window)->must_be_updated_p = true;
pending = update_frame (sf, false, false);
XWINDOW (mini_window)->must_be_updated_p = true;
pending |= update_frame (mini_frame, false, false);
mini_frame->cursor_type_changed = false;
- if (!pending && hscroll_windows (mini_window))
- goto retry;
+ if (!pending && hscroll_retries <= MAX_HSCROLL_RETRIES
+ && hscroll_windows (mini_window))
+ {
+ hscroll_retries++;
+ goto retry;
+ }
}
}