NFLAG(marked)
#undef NFLAG
- if (loc->node->client == NULL &&
- (sel->same_class != OPTION_NONE ||
- sel->tiled != OPTION_NONE ||
- sel->pseudo_tiled != OPTION_NONE ||
- sel->floating != OPTION_NONE ||
- sel->fullscreen != OPTION_NONE ||
- sel->below != OPTION_NONE ||
- sel->normal != OPTION_NONE ||
- sel->above != OPTION_NONE ||
- sel->urgent != OPTION_NONE)) {
- return false;
- }
-
- if (ref->node != NULL && ref->node->client != NULL &&
- sel->same_class != OPTION_NONE &&
- streq(loc->node->client->class_name, ref->node->client->class_name)
- ? sel->same_class == OPTION_FALSE
- : sel->same_class == OPTION_TRUE) {
- return false;
+#define NSPLIT(p, e) \
+ if (sel->p != OPTION_NONE && \
+ loc->node->split_type != e \
+ ? sel->p == OPTION_TRUE \
+ : sel->p == OPTION_FALSE) { \
+ return false; \
}
+ NSPLIT(horizontal, TYPE_HORIZONTAL)
+ NSPLIT(vertical, TYPE_VERTICAL)
+#undef NSPLIT
if (sel->descendant_of != OPTION_NONE &&
!is_descendant(loc->node, ref->node)
return false;
}
+ if (loc->node->client == NULL) {
+ if (sel->same_class == OPTION_TRUE ||
+ sel->tiled == OPTION_TRUE ||
+ sel->pseudo_tiled == OPTION_TRUE ||
+ sel->floating == OPTION_TRUE ||
+ sel->fullscreen == OPTION_TRUE ||
+ sel->below == OPTION_TRUE ||
+ sel->normal == OPTION_TRUE ||
+ sel->above == OPTION_TRUE ||
+ sel->urgent == OPTION_TRUE) {
+ return false;
+ }
+ return true;
+ }
+
+ if (ref->node != NULL && ref->node->client != NULL &&
+ sel->same_class != OPTION_NONE &&
+ streq(loc->node->client->class_name, ref->node->client->class_name)
+ ? sel->same_class == OPTION_FALSE
+ : sel->same_class == OPTION_TRUE) {
+ return false;
+ }
+
#define WSTATE(p, e) \
if (sel->p != OPTION_NONE && \
loc->node->client->state != e \
WFLAG(urgent)
#undef WFLAG
- if (sel->horizontal != OPTION_NONE &&
- loc->node->split_type != TYPE_HORIZONTAL
- ? sel->horizontal == OPTION_TRUE
- : sel->horizontal == OPTION_FALSE) {
- return false;
- }
-
- if (sel->vertical != OPTION_NONE &&
- loc->node->split_type != TYPE_VERTICAL
- ? sel->vertical == OPTION_TRUE
- : sel->vertical == OPTION_FALSE) {
- return false;
- }
-
return true;
}