From eb8d8624d48872af971370699b295f24ec884dbd Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Wed, 2 Aug 2023 23:13:33 +0200 Subject: [PATCH] view: do not emit view-disappeared before changing output 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 --- src/view/view.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/view/view.cpp b/src/view/view.cpp index f0b163840..b87c9dc24 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -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; @@ -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()