Skip to content

Commit

Permalink
view: do not emit view-disappeared before changing output
Browse files Browse the repository at this point in the history
Otherwise, the view might still be refocused on its old output (if it is
being moved to a new output, which corrupts the activated state), see issue #1636.

Fixes #1636
  • Loading branch information
ammen99 committed Aug 2, 2023
1 parent 126f0a4 commit eb8d862
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/view/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,9 @@ wayfire_view wf::view_interface_t::self()
/** Set the view's output. */
void wf::view_interface_t::set_output(wf::output_t *new_output)
{
/* Make sure the view doesn't stay on the old output */
if (get_output() && (get_output() != new_output))
{
view_disappeared_signal data_disappeared;
data_disappeared.view = self();
get_output()->emit(&data_disappeared);
}

view_set_output_signal data;
data.view = self();
data.output = get_output();
data.output = get_output(); // the old output

this->priv->output = new_output;

Expand All @@ -60,6 +52,13 @@ void wf::view_interface_t::set_output(wf::output_t *new_output)
}

wf::get_core().emit(&data);

if (data.output && (data.output != new_output))
{
view_disappeared_signal data_disappeared;
data_disappeared.view = self();
data.output->emit(&data_disappeared);
}
}

wf::output_t*wf::view_interface_t::get_output()
Expand Down

0 comments on commit eb8d862

Please sign in to comment.