Skip to content

Commit

Permalink
floating_maybe_reassign_ws: only re-focus if previously focused
Browse files Browse the repository at this point in the history
Fixes i3#3979
  • Loading branch information
orestisfl authored and stapelberg committed Jul 22, 2020
1 parent dae37a9 commit 96639c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/floating.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 96639c0

Please sign in to comment.