add focused check to if action
This commit is contained in:
parent
6d9bbfb4eb
commit
7c1a008023
1 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,8 @@ typedef struct {
|
||||||
gboolean maxfull_off;
|
gboolean maxfull_off;
|
||||||
gboolean iconic_on;
|
gboolean iconic_on;
|
||||||
gboolean iconic_off;
|
gboolean iconic_off;
|
||||||
|
gboolean focused;
|
||||||
|
gboolean unfocused;
|
||||||
GSList *thenacts;
|
GSList *thenacts;
|
||||||
GSList *elseacts;
|
GSList *elseacts;
|
||||||
} Options;
|
} Options;
|
||||||
|
@ -70,6 +72,12 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
|
||||||
else
|
else
|
||||||
o->iconic_off = TRUE;
|
o->iconic_off = TRUE;
|
||||||
}
|
}
|
||||||
|
if ((n = parse_find_node("focused", node))) {
|
||||||
|
if (parse_bool(doc, n))
|
||||||
|
o->focused = TRUE;
|
||||||
|
else
|
||||||
|
o->unfocused = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if ((n = parse_find_node("then", node))) {
|
if ((n = parse_find_node("then", node))) {
|
||||||
xmlNodePtr m;
|
xmlNodePtr m;
|
||||||
|
@ -118,7 +126,9 @@ static gboolean run_func(ObActionsData *data, gpointer options)
|
||||||
(!o->maxvert_on || (c && c->max_vert)) &&
|
(!o->maxvert_on || (c && c->max_vert)) &&
|
||||||
(!o->maxvert_off || (c && !c->max_vert)) &&
|
(!o->maxvert_off || (c && !c->max_vert)) &&
|
||||||
(!o->maxfull_on || (c && c->max_vert && c->max_horz)) &&
|
(!o->maxfull_on || (c && c->max_vert && c->max_horz)) &&
|
||||||
(!o->maxfull_off || (c && !(c->max_vert && c->max_horz))))
|
(!o->maxfull_off || (c && !(c->max_vert && c->max_horz))) &&
|
||||||
|
(!o->focused || (c && !(c == focus_client))) &&
|
||||||
|
(!o->unfocused || (c && !(c != focus_client))))
|
||||||
{
|
{
|
||||||
acts = o->thenacts;
|
acts = o->thenacts;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue