Browse Source

Add tab rule

Martin Duquesnoy 12 years ago
parent
commit
688dfb34d2
7 changed files with 12 additions and 9 deletions
  1. 5 4
      src/client.c
  2. 1 1
      src/config.c
  3. 1 0
      src/layout.c
  4. 1 0
      src/layout.h
  5. 2 2
      src/tag.c
  6. 1 1
      src/wmfs.h
  7. 1 1
      wmfsrc

+ 5 - 4
src/client.c

@@ -875,20 +875,21 @@ client_apply_rule(struct client *c)
 
                c->theme = r->theme;
 
+               /* free = false for originally free client */
                if(r->flags & RULE_FREE)
                     c->flags |=  CLIENT_FREE;
-               /* free = false for originally free client */
                else
                     c->flags &= ~CLIENT_FREE;
 
+               /* Free rule is not compatible with tab rule */
+               if(r->flags & RULE_TAB)
+                    W->flags ^= WMFS_TABNOC; /* < can be disable by client_tab_next_opened */
 
                /* TODO
-                  if(r->flags & RULE_MAX)
-                  {}
-
                   if(r->flags & RULE_IGNORE_TAG)
                   {}
                */
+
                c->flags |= CLIENT_RULED;
           }
           flags = 0;

+ 1 - 1
src/config.c

@@ -264,7 +264,7 @@ config_rule(void)
           r->tag      = fetch_opt_first(ks[i], "-1", "tag").num;
 
           FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "free").boolean,       RULE_FREE);
-          FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "max").boolean,        RULE_MAX);
+          FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "tab").boolean,        RULE_TAB);
           FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "ignore_tag").boolean, RULE_IGNORE_TAG);
 
           if((tn = fetch_opt_first(ks[i], "", "theme").str))

+ 1 - 0
src/layout.c

@@ -389,6 +389,7 @@ layout_split_integrate(struct client *c, struct client *sc)
           {
                client_maximize(c);
                c->flags |= CLIENT_TILED;
+               W->flags &= ~WMFS_TABNOC;
                return;
           }
      }

+ 1 - 0
src/layout.h

@@ -7,6 +7,7 @@
 #define LAYOUT_H
 
 #include "wmfs.h"
+#include "client.h"
 
 /* Check lateral direction (if p is Right or Left) */
 #define LDIR(P) (P < Top)

+ 2 - 2
src/tag.c

@@ -102,8 +102,6 @@ tag_client(struct tag *t, struct client *c)
 
      infobar_elem_screen_update(t->screen, ElemTag);
 
-     layout_client(c);
-
      if(c->flags & CLIENT_TABMASTER && c->prevtag)
      {
           struct client *cc;
@@ -116,6 +114,8 @@ tag_client(struct tag *t, struct client *c)
                }
      }
 
+     layout_client(c);
+
      if(t != c->screen->seltag || c->flags & CLIENT_TABBED)
           client_unmap(c);
 }

+ 1 - 1
src/wmfs.h

@@ -274,7 +274,7 @@ struct rule
      char *name;
      int tag, screen;
 #define RULE_FREE       0x01
-#define RULE_MAX        0x02
+#define RULE_TAB        0x02
 #define RULE_IGNORE_TAG 0x04
      Flags flags;
      SLIST_ENTRY(rule) next;

+ 1 - 1
wmfsrc

@@ -137,7 +137,7 @@
       screen = 0
 
       free       = false
-      max        = false
+      tab        = false
       ignore_tag = false
   [/rule]