From 13e3aca1cbc322308729d2e6644a420daf811c93 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Tue, 16 Feb 2010 19:53:03 +0100 Subject: improved focus handling --- tabbed.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tabbed.c') diff --git a/tabbed.c b/tabbed.c index ad49536..c053a22 100644 --- a/tabbed.c +++ b/tabbed.c @@ -399,7 +399,6 @@ focus(Client *c) { XStoreName(dpy, win, c->name); if(sel != c) { lastsel = sel; - puts("set"); } sel = c; drawbar(); @@ -605,6 +604,8 @@ manage(Window w) { XSync(dpy, False); focus(nextfocus ? c : sel); nextfocus = foreground; + if(!lastsel) + lastsel = c; } } @@ -794,9 +795,13 @@ unmanage(Client *c) { pc->next = c->next; } if(c == lastsel) - lastsel = pc; - focus(lastsel); + lastsel = clients; + if(c == sel) { + sel = pc; + focus(lastsel); + } free(c); + drawbar(); XSync(dpy, False); } -- cgit v1.2.3