Skip to content

Commit

Permalink
output-layout: keep active workspace when destroying output
Browse files Browse the repository at this point in the history
Currently, when destroying the current output, core focuses the
next output (if any) but does not switch to the same workspace
that the user was previously using. Switch to the same workspace
so the user can pick up where they left off.
  • Loading branch information
lcolitti committed Apr 12, 2024
1 parent 74c2181 commit c97972f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/output-layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,13 @@ struct output_layout_output_t

/* It doesn't make sense to transfer to another output if we're
* going to shut down the compositor */
transfer_views(wo, shutdown ? nullptr : get_core().seat->get_active_output());
wf::output_t *new_output = shutdown ? nullptr : get_core().seat->get_active_output();
transfer_views(wo, new_output);
if (new_output &&
(wo->wset()->get_workspace_grid_size() == new_output->wset()->get_workspace_grid_size()))
{
new_output->wset()->set_workspace(wo->wset()->get_current_workspace());
}

wf::output_removed_signal data2;
data2.output = wo;
Expand Down

0 comments on commit c97972f

Please sign in to comment.