Resolve node paths relative to the given reference

This commit is contained in:
Bastien Dejean 2016-05-19 21:26:20 +02:00
parent cfc69985ea
commit 3a27fb66ca

View file

@ -430,7 +430,9 @@ int node_from_desc(char *desc, coordinates_t *ref, coordinates_t *dst)
return ret; return ret;
} }
} }
dst->node = (*desc == '/' ? dst->desktop->root : dst->desktop->focus); if (*desc == '/') {
dst->node = dst->desktop->root;
}
char *move = strtok(desc, PTH_TOK); char *move = strtok(desc, PTH_TOK);
while (move != NULL && dst->node != NULL) { while (move != NULL && dst->node != NULL) {
if (streq("first", move) || streq("1", move)) { if (streq("first", move) || streq("1", move)) {