Subject: Re: bug#14616: 24.3.50; Excessive cursor movement on non-X Emacs

From: Eli Zaretskii <[email-masked]>
Date: Tue, 06 Aug 2013 18:26:36 +0300

> From: Lars Magne Ingebrigtsen <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 05 Aug 2013 22:20:32 +0200
> 
> > They oscillate.  Makes sense, but I don't see why should that happen.
> 
> If it loops over all the frames and switches to them, and this happens
> every time redisplay happens (because of accept-process-output), then
> that seems natural.  But wrong.  :-)

Does the change below help?

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2013-08-03 18:16:43 +0000
+++ src/xdisp.c	2013-08-06 15:24:02 +0000
@@ -11181,7 +11181,9 @@ prepare_menu_bars (void)
 	{
 	  f = XFRAME (frame);
 	  if (!EQ (frame, tooltip_frame)
-	      && (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)))
+	      && (FRAME_ICONIFIED_P (f)
+		  || FRAME_VISIBLE_P (f) == 1
+		  || (FRAME_VISIBLE_P (f) == 2 && FRAME_WINDOW_P (f))))
 	    x_consider_frame_title (frame);
 	}
     }