implement unmark command

This commit is contained in:
koebi
2013-07-16 00:33:14 +02:00
committed by Michael Stapelberg
parent 35aec2f038
commit 88671986f4
7 changed files with 127 additions and 7 deletions

View File

@ -1031,6 +1031,31 @@ void cmd_mark(I3_CMD, char *mark) {
ysuccess(true);
}
/*
* Implementation of 'unmark [mark]'
*
*/
void cmd_unmark(I3_CMD, char *mark) {
if (mark == NULL) {
Con *con;
TAILQ_FOREACH(con, &all_cons, all_cons) {
FREE(con->mark);
}
DLOG("removed all window marks");
} else {
Con *con;
TAILQ_FOREACH(con, &all_cons, all_cons) {
if (con->mark && strcmp(con->mark, mark) == 0)
FREE(con->mark);
}
DLOG("removed window mark %s\n", mark);
}
cmd_output->needs_tree_render = true;
// XXX: default reply for now, make this a better reply
ysuccess(true);
}
/*
* Implementation of 'mode <string>'.
*