aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.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/layout.c
parent84f01a67bdaef4dbff787caa4b076ed60e257c51 (diff)
find_parent_by_type
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 78b3dd27..8c011fdb 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -161,10 +161,7 @@ void arrange_windows(swayc_t *container, int width, int height) {
}
};
if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {
- swayc_t *parent = container;
- while (parent->type != C_OUTPUT) {
- parent = parent->parent;
- }
+ swayc_t *parent = swayc_parent_by_type(container, C_OUTPUT);
geometry.origin.x = 0;
geometry.origin.y = 0;
geometry.size.w = parent->width;
@@ -263,10 +260,7 @@ void arrange_windows(swayc_t *container, int width, int height) {
}
};
if (wlc_view_get_state(view->handle) & WLC_BIT_FULLSCREEN) {
- swayc_t *parent = view;
- while (parent->type != C_OUTPUT) {
- parent = parent->parent;
- }
+ swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT);
geometry.origin.x = 0;
geometry.origin.y = 0;
geometry.size.w = parent->width;