From 960670b16c15e992620157b26a5cd2d188ba00c5 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 21 Mar 2024 14:35:22 +0100 Subject: [PATCH] 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. --- repos/os/include/decorator/window.h | 7 +++++-- repos/os/include/decorator/window_stack.h | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/repos/os/include/decorator/window.h b/repos/os/include/decorator/window.h index 59f9d545ed..023c437054 100644 --- a/repos/os/include/decorator/window.h +++ b/repos/os/include/decorator/window.h @@ -142,11 +142,14 @@ class Decorator::Window_base : private Genode::List_model::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; } diff --git a/repos/os/include/decorator/window_stack.h b/repos/os/include/decorator/window_stack.h index 636b3de00b..9cd28a5ef3 100644 --- a/repos/os/include/decorator/window_stack.h +++ b/repos/os/include/decorator/window_stack.h @@ -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))