changeset 71378:1b442e9d8373

(update_frame): Check for input pending on entry. (update_window, update_frame_1): Break loop if input is detected.
author Kim F. Storm <storm@cua.dk>
date Sat, 17 Jun 2006 00:11:59 +0000
parents 37aa828fafd2
children cb6e677b13d4
files src/dispnew.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Sat Jun 17 00:11:48 2006 +0000
+++ b/src/dispnew.c	Sat Jun 17 00:11:59 2006 +0000
@@ -3849,6 +3849,12 @@
       double p = XFLOATINT (Vredisplay_preemption_period);
       int sec, usec;
 
+      if (detect_input_pending_ignore_squeezables ())
+	{
+	  paused_p = 1;
+	  goto do_pause;
+	}
+
       sec = (int) p;
       usec = (p - sec) * 1000000;
 
@@ -3936,6 +3942,7 @@
 #endif
     }
 
+ do_pause:
   /* Reset flags indicating that a window should be updated.  */
   set_window_update_flags (root_window, 0);
 
@@ -4262,7 +4269,8 @@
 		if (EMACS_TIME_NEG_P (dif))
 		  {
 		    EMACS_ADD_TIME (preemption_next_check, tm, preemption_period);
-		    detect_input_pending_ignore_squeezables ();
+		    if (detect_input_pending_ignore_squeezables ())
+		      break;
 		  }
 	      }
 #else
@@ -5288,7 +5296,8 @@
 	      if (EMACS_TIME_NEG_P (dif))
 		{
 		  EMACS_ADD_TIME (preemption_next_check, tm, preemption_period);
-		  detect_input_pending_ignore_squeezables ();
+		  if (detect_input_pending_ignore_squeezables ())
+		    break;
 		}
 	    }
 #else