From e83ace4242005f95cf562a9c14150cec99d43850 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 10 Sep 2024 16:36:45 +0200 Subject: [PATCH] decorator: fix window-stacking glitch This is a follow-up commit to "gui_session: manage view ID at the client side", which missed to invalidate the neighbor view of a window but instead wrongly assigned the (now always valid) view ID 0 as neighbor. In situations where a window disappears and re-appears (e.g., repeatedly launching testnit in the wm.run scenario), the new window could not always be topped. Issue #5242 --- repos/os/include/decorator/window.h | 2 ++ repos/os/include/decorator/window_stack.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/repos/os/include/decorator/window.h b/repos/os/include/decorator/window.h index e5a54cc487..bc097c9de8 100644 --- a/repos/os/include/decorator/window.h +++ b/repos/os/include/decorator/window.h @@ -141,6 +141,8 @@ class Decorator::Window_base : private Genode::List_model::Element _stacked = true; } + void forget_neighbor() { _neighbor.destruct(); } + bool back_most() const { return _stacked && !_neighbor.constructed(); diff --git a/repos/os/include/decorator/window_stack.h b/repos/os/include/decorator/window_stack.h index 518cecbfe2..e305a84d49 100644 --- a/repos/os/include/decorator/window_stack.h +++ b/repos/os/include/decorator/window_stack.h @@ -257,7 +257,7 @@ void Decorator::Window_stack::update_model(Genode::Xml_node root_node, reversed.remove(back_most); Window_base &window = *back_most->object(); stack_back_most_window(window); - window.stacking_neighbor(Gui::View_id()); + window.forget_neighbor(); Window_base *neighbor = &window;