Allow multiple marks on windows.

This patch allows multiple marks to be set on a single window. The restriction that a mark may
only be on one window at a time is still upheld as this is necessary for commands like
"move window to mark" to make sense.

relates to #2014
This commit is contained in:
Ingo Bürk
2015-10-19 18:10:20 +02:00
parent 0425f48835
commit 9bb2f038ab
12 changed files with 238 additions and 70 deletions

View File

@ -290,10 +290,16 @@ void cmd_criteria_match_windows(I3_CMD) {
DLOG("doesnt match\n");
free(current);
}
} else if (current_match->mark != NULL && current->con->mark != NULL &&
regex_matches(current_match->mark, current->con->mark)) {
DLOG("match by mark\n");
TAILQ_INSERT_TAIL(&owindows, current, owindows);
} else if (current_match->mark != NULL && !TAILQ_EMPTY(&(current->con->marks_head))) {
mark_t *mark;
TAILQ_FOREACH(mark, &(current->con->marks_head), marks) {
if (!regex_matches(current_match->mark, mark->name))
continue;
DLOG("match by mark\n");
TAILQ_INSERT_TAIL(&owindows, current, owindows);
break;
}
} else {
if (current->con->window && match_matches_window(current_match, current->con->window)) {
DLOG("matches window!\n");