Subject: bug#34138: 27.0.50; Delayed display of PDF file images

From: martin rudalics <[email-masked]>
Date: Sat, 26 Jan 2019 16:07:41 +0100

> That's at the beginning of redisplay, so yes, I think it's a better
 > place.

Patch attached.  Everybody involved, please try.

Thanks, martin
diff --git a/src/xdisp.c b/src/xdisp.c
index 8649507..ed4474e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14153,6 +14153,9 @@ static void debug_method_add (struct window *, char const *, ...)
       clear_garbaged_frames ();
     }
 
+  if (!NILP (Vrun_hooks))
+    run_window_change_functions ();
+
   if (windows_or_buffers_changed && !update_mode_lines)
     /* Code that sets windows_or_buffers_changed doesn't distinguish whether
        only the windows's contents needs to be refreshed, or whether the
@@ -14332,18 +14335,6 @@ static void debug_method_add (struct window *, char const *, ...)
 		  && (w = XWINDOW (selected_window)) != sw)
 		goto retry;
 
-	      if (!NILP (Vrun_hooks))
-		{
-		  run_window_change_functions ();
-
-		  /* If windows or buffers changed or selected_window
-		     changed, redisplay again.  */
-		  if ((windows_or_buffers_changed)
-		      || (WINDOWP (selected_window)
-			  && (w = XWINDOW (selected_window)) != sw))
-		    goto retry;
-		}
-
 		/* We used to always goto end_of_redisplay here, but this
 		 isn't enough if we have a blinking cursor.  */
 	      if (w->cursor_off_p == w->last_cursor_off_p)
@@ -14707,18 +14698,6 @@ static void debug_method_add (struct window *, char const *, ...)
 	  && (w = XWINDOW (selected_window)) != sw))
     goto retry;
 
-  if (!NILP (Vrun_hooks))
-    {
-      run_window_change_functions ();
-
-      /* If windows or buffers changed or selected_window changed,
-	 redisplay again.  */
-      if ((windows_or_buffers_changed)
-	  || (WINDOWP (selected_window)
-	      && (w = XWINDOW (selected_window)) != sw))
-	goto retry;
-    }
-
   /* Clear the face and image caches.
 
      We used to do this only if consider_all_windows_p.  But the cache