decorator: fix handling of back-most window

Before, the current back-most window was not restacked if it was part of
the already, which lead to partially inconsistent view of the window
stack between decorator and nitpicker.
This commit is contained in:
Christian Helmuth 2024-03-21 14:35:22 +01:00
parent 219eecf8d7
commit 960670b16c
2 changed files with 7 additions and 4 deletions

View File

@ -142,11 +142,14 @@ class Decorator::Window_base : private Genode::List_model<Window_base>::Element
_stacked = true;
}
bool stacked() const { return _stacked; }
bool back_most() const
{
return _stacked && !_neighbor.valid();
}
bool in_front_of(Window_base const &neighbor) const
{
return _neighbor == neighbor.frontmost_view();
return _stacked && (_neighbor == neighbor.frontmost_view());
}
void geometry(Rect geometry) { _geometry = geometry; }

View File

@ -230,7 +230,7 @@ void Decorator::Window_stack::update_model(Genode::Xml_node root_node,
auto stack_back_most_window = [&] (Window_base &window) {
if (window.stacked())
if (window.back_most())
return;
if (new_front_most_window(window))
@ -243,7 +243,7 @@ void Decorator::Window_stack::update_model(Genode::Xml_node root_node,
auto stack_window = [&] (Window_base &window, Window_base &neighbor) {
if (window.stacked() && window.in_front_of(neighbor))
if (window.in_front_of(neighbor))
return;
if (new_front_most_window(window))