Add tab rule

This commit is contained in:
Martin Duquesnoy 2012-02-02 11:15:21 +01:00
parent e484510f52
commit 688dfb34d2
7 changed files with 12 additions and 9 deletions

View File

@ -875,20 +875,21 @@ client_apply_rule(struct client *c)
c->theme = r->theme; c->theme = r->theme;
/* free = false for originally free client */
if(r->flags & RULE_FREE) if(r->flags & RULE_FREE)
c->flags |= CLIENT_FREE; c->flags |= CLIENT_FREE;
/* free = false for originally free client */
else else
c->flags &= ~CLIENT_FREE; 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 /* TODO
if(r->flags & RULE_MAX)
{}
if(r->flags & RULE_IGNORE_TAG) if(r->flags & RULE_IGNORE_TAG)
{} {}
*/ */
c->flags |= CLIENT_RULED; c->flags |= CLIENT_RULED;
} }
flags = 0; flags = 0;

View File

@ -264,7 +264,7 @@ config_rule(void)
r->tag = fetch_opt_first(ks[i], "-1", "tag").num; 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", "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); FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "ignore_tag").boolean, RULE_IGNORE_TAG);
if((tn = fetch_opt_first(ks[i], "", "theme").str)) if((tn = fetch_opt_first(ks[i], "", "theme").str))

View File

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

View File

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

View File

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

View File

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

2
wmfsrc
View File

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