do not match docks in config and command criteria (#2340)

This commit is contained in:
johannes karoff
2016-09-26 18:45:58 +02:00
committed by Michael Stapelberg
parent 655ed0ba27
commit 1437271e65
5 changed files with 75 additions and 3 deletions

View File

@ -480,7 +480,7 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
if (match->restart_mode)
continue;
y(map_open);
if (match->dock != -1) {
if (match->dock != M_DONTCHECK) {
ystr("dock");
y(integer, match->dock);
ystr("insert_where");

View File

@ -48,6 +48,7 @@ static int json_start_map(void *ctx) {
LOG("creating new swallow\n");
current_swallow = smalloc(sizeof(Match));
match_init(current_swallow);
current_swallow->dock = M_DONTCHECK;
TAILQ_INSERT_TAIL(&(json_node->swallow_head), current_swallow, matches);
swallow_is_empty = true;
} else {

View File

@ -27,7 +27,6 @@
*/
void match_init(Match *match) {
memset(match, 0, sizeof(Match));
match->dock = M_DONTCHECK;
match->urgent = U_DONTCHECK;
/* we use this as the placeholder value for "not set". */
match->window_type = UINT32_MAX;
@ -53,7 +52,7 @@ bool match_is_empty(Match *match) {
match->id == XCB_NONE &&
match->window_type == UINT32_MAX &&
match->con_id == NULL &&
match->dock == -1 &&
match->dock == M_NODOCK &&
match->floating == M_ANY);
}

View File

@ -240,6 +240,7 @@ static void open_placeholder_window(Con *con) {
/* create temporary id swallow to match the placeholder */
Match *temp_id = smalloc(sizeof(Match));
match_init(temp_id);
temp_id->dock = M_DONTCHECK;
temp_id->id = placeholder;
TAILQ_INSERT_HEAD(&(con->swallow_head), temp_id, matches);
}