Re: [dev] Focus previously focused window

From: Manolo Martínez <manolo_AT_austrohungaro.com>
Date: Thu, 13 Dec 2012 16:25:00 -0500

On 12/13/12 at 03:20pm, Eric Pruitt wrote:
> 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 http://dwm.suckless.org/patches/swapfocus. 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.
>
> Eric

Thanks! I'm sure one of these will do the trick. The use case is pretty
simple, actually.

Manolo
Received on Thu Dec 13 2012 - 22:25:00 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 13 2012 - 22:36:04 CET