Re: [PATCH] Make RC_OTHER always choose some other

Sadrul Habib Chowdhury <[email protected]> Fri, 19 Sep 2008 03:48:08 -0400
Newsgroups gmane.comp.gnu.screen
Message-ID <20080919074808.GB20154__46097.501499071$1238089066$gmane$org@localdomain>
* Jeroen Roovers had this to say on [18 Sep 2008, 18:52:11 +0200]:
[snip]
> 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)

The patch, as it is, looks good. Thanks!

But, perhaps a more appropriate fix would be to make sure that
display->d_other is updated appropriately? Do you have a screenrc file
that can be used to easily reproduce the bug?

Sadrul