Merge pull request #4012 from orestisfl/floating_maybe_reassign_ws_focus

floating_maybe_reassign_ws: only re-focus if previously focused
next
Ingo Bürk 2020-04-11 19:49:53 +02:00 committed by GitHub
commit 93bb2022bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -514,9 +514,15 @@ bool floating_maybe_reassign_ws(Con *con) {
Con *content = output_get_content(output->con);
Con *ws = TAILQ_FIRST(&(content->focus_head));
DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name);
Con *needs_focus = con_descend_focused(con);
if (!con_inside_focused(needs_focus)) {
needs_focus = NULL;
}
con_move_to_workspace(con, ws, false, true, false);
workspace_show(ws);
con_activate(con_descend_focused(con));
if (needs_focus) {
workspace_show(ws);
con_activate(needs_focus);
}
return true;
}