[hackers] [tabbed] improved focus handling || Enno Boland (tox)

From: <hg_AT_suckless.org>
Date: Tue, 16 Feb 2010 18:53:09 +0000 (UTC)

changeset: 133:3e3f0a134330
tag: tip
user: Enno Boland (tox) <tox_AT_s01.de>
date: Tue Feb 16 19:53:03 2010 +0100
files: config.def.h tabbed.c
description:
improved focus handling

diff -r 363e60546fc0 -r 3e3f0a134330 config.def.h
--- a/config.def.h Tue Dec 15 09:26:01 2009 +0100
+++ b/config.def.h Tue Feb 16 19:53:03 2010 +0100
@@ -11,6 +11,7 @@
 #define MODKEY ControlMask
 static Key keys[] = { \
         /* modifier key function argument */
+ { MODKEY|ShiftMask, XK_Return, focusonce, { 0 } },
         { MODKEY|ShiftMask, XK_Return, spawn, { .v = (char*[]){ "surf", "-e", winid, NULL} } },
         { MODKEY|ShiftMask, XK_l, rotate, { .i = +1 } },
         { MODKEY|ShiftMask, XK_h, rotate, { .i = -1 } },
diff -r 363e60546fc0 -r 3e3f0a134330 tabbed.c
--- a/tabbed.c Tue Dec 15 09:26:01 2009 +0100
+++ b/tabbed.c Tue Feb 16 19:53:03 2010 +0100
@@ -399,7 +399,6 @@
         XStoreName(dpy, win, c->name);
         if(sel != c) {
                 lastsel = sel;
- puts("set");
         }
         sel = c;
         drawbar();
@@ -605,6 +604,8 @@
                 XSync(dpy, False);
                 focus(nextfocus ? c : sel);
                 nextfocus = foreground;
+ if(!lastsel)
+ lastsel = c;
         }
 }
 
@@ -794,9 +795,13 @@
                 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);
 }
 
Received on Tue Feb 16 2010 - 18:53:09 UTC

This archive was generated by hypermail 2.2.0 : Tue Feb 16 2010 - 19:00:10 UTC