diff options
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 849a18ad..6e32c932 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -270,39 +270,6 @@ static void workspace_rejigger(struct sway_workspace *ws, | |||
270 | child->width = child->height = 0; | 270 | child->width = child->height = 0; |
271 | } | 271 | } |
272 | 272 | ||
273 | static void move_out_of_tabs_stacks(struct sway_container *container, | ||
274 | struct sway_container *current, enum movement_direction move_dir, | ||
275 | int offs) { | ||
276 | enum sway_container_layout layout = move_dir == | ||
277 | MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; | ||
278 | list_t *siblings = container_get_siblings(container); | ||
279 | if (container == current && siblings->length == 1) { | ||
280 | wlr_log(WLR_DEBUG, "Changing layout of parent"); | ||
281 | if (container->parent) { | ||
282 | container->parent->layout = layout; | ||
283 | container_update_representation(container); | ||
284 | } else { | ||
285 | container->workspace->layout = layout; | ||
286 | workspace_update_representation(container->workspace); | ||
287 | } | ||
288 | return; | ||
289 | } | ||
290 | |||
291 | wlr_log(WLR_DEBUG, "Moving out of tab/stack into a split"); | ||
292 | if (current->parent) { | ||
293 | struct sway_container *new_parent = | ||
294 | container_split(current->parent, layout); | ||
295 | container_insert_child(new_parent, container, offs < 0 ? 0 : 1); | ||
296 | container_reap_empty(new_parent); | ||
297 | container_flatten(new_parent); | ||
298 | } else { | ||
299 | // Changing a workspace | ||
300 | struct sway_workspace *workspace = container->workspace; | ||
301 | workspace_split(workspace, layout); | ||
302 | workspace_insert_tiling(workspace, container, offs < 0 ? 0 : 1); | ||
303 | } | ||
304 | } | ||
305 | |||
306 | // Returns true if moved | 273 | // Returns true if moved |
307 | static bool container_move_in_direction(struct sway_container *container, | 274 | static bool container_move_in_direction(struct sway_container *container, |
308 | enum movement_direction move_dir) { | 275 | enum movement_direction move_dir) { |
@@ -334,7 +301,6 @@ static bool container_move_in_direction(struct sway_container *container, | |||
334 | int offs = move_dir == MOVE_LEFT || move_dir == MOVE_UP ? -1 : 1; | 301 | int offs = move_dir == MOVE_LEFT || move_dir == MOVE_UP ? -1 : 1; |
335 | 302 | ||
336 | while (current) { | 303 | while (current) { |
337 | struct sway_container *parent = current->parent; | ||
338 | list_t *siblings = container_get_siblings(current); | 304 | list_t *siblings = container_get_siblings(current); |
339 | enum sway_container_layout layout = container_parent_layout(current); | 305 | enum sway_container_layout layout = container_parent_layout(current); |
340 | int index = list_find(siblings, current); | 306 | int index = list_find(siblings, current); |
@@ -343,15 +309,8 @@ static bool container_move_in_direction(struct sway_container *container, | |||
343 | if (is_parallel(layout, move_dir)) { | 309 | if (is_parallel(layout, move_dir)) { |
344 | if (desired == -1 || desired == siblings->length) { | 310 | if (desired == -1 || desired == siblings->length) { |
345 | if (current->parent == container->parent) { | 311 | if (current->parent == container->parent) { |
346 | if (!(parent && parent->is_fullscreen) && | 312 | current = current->parent; |
347 | (layout == L_TABBED || layout == L_STACKED)) { | 313 | continue; |
348 | move_out_of_tabs_stacks(container, current, | ||
349 | move_dir, offs); | ||
350 | return true; | ||
351 | } else { | ||
352 | current = current->parent; | ||
353 | continue; | ||
354 | } | ||
355 | } else { | 314 | } else { |
356 | // Special case | 315 | // Special case |
357 | if (current->parent) { | 316 | if (current->parent) { |
@@ -369,10 +328,6 @@ static bool container_move_in_direction(struct sway_container *container, | |||
369 | siblings->items[desired], move_dir); | 328 | siblings->items[desired], move_dir); |
370 | return true; | 329 | return true; |
371 | } | 330 | } |
372 | } else if (!(parent && parent->is_fullscreen) && | ||
373 | (layout == L_TABBED || layout == L_STACKED)) { | ||
374 | move_out_of_tabs_stacks(container, current, move_dir, offs); | ||
375 | return true; | ||
376 | } | 331 | } |
377 | 332 | ||
378 | current = current->parent; | 333 | current = current->parent; |