Re: [dev] Focus previously focused window

From: Eric Pruitt <>
Date: Thu, 13 Dec 2012 15:20:18 -0600

Hey Manolo,

On Thu, Dec 13, 2012 at 03:04:01PM -0500, Manolo Martínez wrote:
> I was wondering if anyone knows of a patch that provides the means to
> return to the previously focused window (if it exists). That is, for
> example, if I'm
> on window1 and launch a window2, MOD+p (say) would take me back to
> window1.

There's the swapfocus patch at The
downside to this patch is that it remembers _only_ the most recently selected
window, and changing tag sets or opening and closing windows will often strip
you of the ability to go back to a previously selected client.

I wrote an alternate version of swapfocus that sorta works on a per-tag basis.
See the patch comments for an explanation of the "sorta" part. That patch had
its own problems as well, specifically that due to the way I wrote it, opening
a new window would throw of the previous client selection at times. Some days
ago, I decided to take a completely different approach and wrote the
"lastclient.diff" patch that is also attached. With this patch, every time a
window is focused, the time the window was focused is recorded. When you call
the lastclient function, the most recently focused window is selected which
eliminates problems with changing tags, but depending on your workflow, the
focused timestamp base approach may throw you off at times.


Received on Thu Dec 13 2012 - 22:20:18 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 13 2012 - 22:24:07 CET