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
This commit is contained in:
Norman Feske 2024-09-10 16:36:45 +02:00
parent f147a1220e
commit e83ace4242
2 changed files with 3 additions and 1 deletions

View File

@ -141,6 +141,8 @@ class Decorator::Window_base : private Genode::List_model<Window_base>::Element
_stacked = true;
}
void forget_neighbor() { _neighbor.destruct(); }
bool back_most() const
{
return _stacked && !_neighbor.constructed();

View File

@ -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;