[PATCH] Make RC_OTHER always choose some other

Jeroen Roovers <[email protected]> Thu, 18 Sep 2008 18:52:11 +0200
Newsgroups gmane.comp.gnu.screen
Message-ID <20080918185211.5dd27a93__8163.11076418987$1238089065$gmane$org@epia.jer-c2.orkz.net>
--MP_/5yoqB5ZOG0FHqfLaoUIO.+W
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

     Hi screen developers,


I am currently testing this tiny patch, which I offer you to review.
The patch is self-explanatory, I hope.


Kind regards,
     JeR
--MP_/5yoqB5ZOG0FHqfLaoUIO.+W
Content-Type: text/x-patch; name=screen-4.0.3_p20080723-This_IS.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=screen-4.0.3_p20080723-This_IS.patch

Sometimes when you do RC_OTHER, you get presented with "This IS window (n)."
That's rather stupid as you didn't even ask for window n in the first place,
but simply _some_ other window. -JeR

--- process.c.orig	2008-07-23 08:36:05.000000000 +0200
+++ process.c	2008-09-18 18:21:19.000000000 +0200
@@ -1731,7 +1731,7 @@
       /* FALLTHROUGH */
     case RC_OTHER:
       if (MoreWindows())
-	SwitchWindow(display && D_other ? D_other->w_number : NextWindow());
+	SwitchWindow(display && (D_other != fore) ? D_other->w_number : NextWindow());
       break;
     case RC_META:
       if (user->u_Esc == -1)

--MP_/5yoqB5ZOG0FHqfLaoUIO.+W--