Skip to content

Commit

Permalink
Fixed the multiple window movement issue from #5382
Browse files Browse the repository at this point in the history
  • Loading branch information
slyshot committed Jun 18, 2023
1 parent a958701 commit 98978e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions release-notes/bugfixes/3-moving-multiple
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the multiple window movement issue from #5382
16 changes: 14 additions & 2 deletions src/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,20 @@ void tree_move(Con *con, direction_t direction) {
/* 1: get the first parent with the same orientation */

if (con->type == CT_WORKSPACE) {
DLOG("Not moving workspace\n");
return;
/* If there is already a split container for the windows in the workspace, use that. */
/* Otherwise, make a split container for them and move that split container. This way, moving multiple windows at a time from a workspace works as expected. */
const bool moves_focus = (focused == con);
Con *first_child = TAILQ_FIRST(&(con->nodes_head));
if (!con_is_leaf(first_child) && con_num_children(con) == 1) {
con = first_child;
} else {
if ((con = workspace_encapsulate(con)) == NULL) {
return;
}
}
if (moves_focus) {
con_focus(con);
}
}

if (con->fullscreen_mode == CF_GLOBAL) {
Expand Down

0 comments on commit 98978e1

Please sign in to comment.