From: Noam Postavsky Date: Fri, 4 May 2018 00:54:25 +0000 (-0400) Subject: Handle selected_window change in prepare_menu_bars (Bug#31312) X-Git-Tag: emacs-26.1~48 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b90ce66d32ede14a9191008096e596f6dfb9a48b;p=emacs.git Handle selected_window change in prepare_menu_bars (Bug#31312) * src/xdisp.c (redisplay_internal): Check selected_window after calling prepare_menu_bars, since it can call lisp hooks. --- diff --git a/src/xdisp.c b/src/xdisp.c index fb6729c36aa..d6aabd06189 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13924,11 +13924,6 @@ redisplay_internal (void) /* Notice any pending interrupt request to change frame size. */ do_pending_window_change (true); - /* do_pending_window_change could change the selected_window due to - frame resizing which makes the selected window too small. */ - if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw) - sw = w; - /* Clear frames marked as garbaged. */ clear_garbaged_frames (); @@ -13936,6 +13931,13 @@ redisplay_internal (void) if (NILP (Vmemory_full)) prepare_menu_bars (); + /* do_pending_window_change could change the selected_window due to + frame resizing which makes the selected window too small. + prepare_menu_bars may call lisp hooks and hence also change the + selected_window. */ + if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw) + sw = w; + reconsider_clip_changes (w); /* In most cases selected window displays current buffer. */