find_parent_by_type

This commit is contained in:
taiyu 2015-08-20 09:52:54 -07:00
parent 84f01a67bd
commit 36e07e9ebc
6 changed files with 112 additions and 71 deletions

View file

@ -75,9 +75,7 @@ char *workspace_next_name(void) {
swayc_t *workspace_create(const char* name) {
swayc_t *parent = get_focused_container(&root_container);
while (parent->type != C_OUTPUT) {
parent = parent->parent;
}
parent = swayc_parent_by_type(parent, C_OUTPUT);
return new_workspace(parent, name);
}