aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-20 09:52:54 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-20 09:52:54 -0700
commit36e07e9ebc55b3fc8a8b8cd76ee743202691ad56 (patch)
treee9e2a9d9db46044ab7cd7bd4dcb7ca2650a89f70 /sway/commands.c
parent84f01a67bdaef4dbff787caa4b076ed60e257c51 (diff)
find_parent_by_type
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 644b8005..3ac7f4dd 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -390,7 +390,6 @@ static bool cmd_layout(struct sway_config *config, int argc, char **argv) {
return false;
}
swayc_t *parent = get_focused_container(&root_container);
-
while (parent->type == C_VIEW) {
parent = parent->parent;
}
@@ -512,9 +511,7 @@ static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) {
// Resize workspace if going from fullscreen -> notfullscreen
// otherwise just resize container
if (current) {
- while (container->type != C_WORKSPACE) {
- container = container->parent;
- }
+ container = swayc_parent_by_type(container, C_WORKSPACE);
}
// Only resize container when going into fullscreen
arrange_windows(container, -1, -1);