JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
using double-linked list in order to get correct prev focus handling
[dwm.git] / tag.c
diff --git a/tag.c b/tag.c
index d6c349b..21eb9fa 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -25,17 +25,19 @@ static Rule rule[] = {
        { "Gimp.*",             { 0 },                          True},
 };
 
-/* extern */
-
-/* CUSTOMIZE */
 char *tags[TLast] = {
        [Tscratch] = "scratch",
        [Tdev] = "dev",
        [Twww] = "www",
        [Twork] = "work",
 };
+
 void (*arrange)(Arg *) = dotile;
 
+/* END CUSTOMIZE */
+
+/* extern */
+
 void
 appendtag(Arg *arg)
 {
@@ -138,6 +140,13 @@ getnext(Client *c, unsigned int t)
        return c;
 }
 
+Client *
+getprev(Client *c)
+{
+       for(; c && !c->tags[tsel]; c = c->prev);
+       return c;
+}
+
 void
 heretag(Arg *arg)
 {