summaryrefslogtreecommitdiff
path: root/sway/workspace.c
diff options
context:
space:
mode:
authortaiyu <[email protected]>2015-08-20 09:52:54 -0700
committertaiyu <[email protected]>2015-08-20 09:52:54 -0700
commit36e07e9ebc55b3fc8a8b8cd76ee743202691ad56 (patch)
treee9e2a9d9db46044ab7cd7bd4dcb7ca2650a89f70 /sway/workspace.c
parent84f01a67bdaef4dbff787caa4b076ed60e257c51 (diff)
find_parent_by_type
Diffstat (limited to 'sway/workspace.c')
-rw-r--r--sway/workspace.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sway/workspace.c b/sway/workspace.c
index 0f44d3b0..d436da8e 100644
--- a/sway/workspace.c
+++ b/sway/workspace.c
@@ -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);
}