diff options
author | 2015-08-24 01:11:21 -0700 | |
---|---|---|
committer | 2015-08-24 01:11:21 -0700 | |
commit | dbad30a409b83d2e327e5eb2a53b46f12e462258 (patch) | |
tree | beedc915a86c4a1109fd0cf4de7961642ccd8354 /sway/input_state.c | |
parent | Merge branch 'master' of https://github.com/SirCmpwn/sway (diff) | |
download | sway-dbad30a409b83d2e327e5eb2a53b46f12e462258.tar.gz sway-dbad30a409b83d2e327e5eb2a53b46f12e462258.tar.zst sway-dbad30a409b83d2e327e5eb2a53b46f12e462258.zip |
add limit to swayc_in_direction
Diffstat (limited to 'sway/input_state.c')
-rw-r--r-- | sway/input_state.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sway/input_state.c b/sway/input_state.c index e911d9cf..10425c57 100644 --- a/sway/input_state.c +++ b/sway/input_state.c | |||
@@ -119,15 +119,20 @@ static void set_initial_view(swayc_t *view) { | |||
119 | 119 | ||
120 | static void set_initial_sibling(void) { | 120 | static void set_initial_sibling(void) { |
121 | bool reset = true; | 121 | bool reset = true; |
122 | if ((initial.horiz.ptr = get_swayc_in_direction(initial.ptr, lock.left ? MOVE_RIGHT: MOVE_LEFT))) { | 122 | swayc_t *ws = swayc_active_workspace_for(initial.ptr); |
123 | if ((initial.horiz.ptr = get_swayc_in_direction_under(initial.ptr, | ||
124 | lock.left ? MOVE_RIGHT: MOVE_LEFT, ws))) { | ||
123 | initial.horiz.w = initial.horiz.ptr->width; | 125 | initial.horiz.w = initial.horiz.ptr->width; |
124 | initial.horiz.parent.ptr = get_swayc_in_direction(initial.horiz.ptr, lock.left ? MOVE_LEFT : MOVE_RIGHT); | 126 | initial.horiz.parent.ptr = get_swayc_in_direction_under(initial.horiz.ptr, |
127 | lock.left ? MOVE_LEFT : MOVE_RIGHT, ws); | ||
125 | initial.horiz.parent.w = initial.horiz.parent.ptr->width; | 128 | initial.horiz.parent.w = initial.horiz.parent.ptr->width; |
126 | reset = false; | 129 | reset = false; |
127 | } | 130 | } |
128 | if ((initial.vert.ptr = get_swayc_in_direction(initial.ptr, lock.top ? MOVE_DOWN: MOVE_UP))) { | 131 | if ((initial.vert.ptr = get_swayc_in_direction_under(initial.ptr, |
132 | lock.top ? MOVE_DOWN: MOVE_UP, ws))) { | ||
129 | initial.vert.h = initial.vert.ptr->height; | 133 | initial.vert.h = initial.vert.ptr->height; |
130 | initial.vert.parent.ptr = get_swayc_in_direction(initial.vert.ptr, lock.top ? MOVE_UP : MOVE_DOWN); | 134 | initial.vert.parent.ptr = get_swayc_in_direction_under(initial.vert.ptr, |
135 | lock.top ? MOVE_UP : MOVE_DOWN, ws); | ||
131 | initial.vert.parent.h = initial.vert.parent.ptr->height; | 136 | initial.vert.parent.h = initial.vert.parent.ptr->height; |
132 | reset = false; | 137 | reset = false; |
133 | } | 138 | } |