Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple window movement issue #5521

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -265,8 +265,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 (first_child != NULL && !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