From 3067a2c51d0ba58cd9ca4bd8b28586528d650f02 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 3 Dec 2024 15:18:02 +0100 Subject: [PATCH] nitpicker: prevent the pointer from going nowhere The 'size_changed' handling remained without effect when the (last) display re-appears (e.g., back from screen blank) because 'Capture_root::bounding_box()' delivered the '_fallback_bounding_box' in the intermediate phase where no display was present. Unfortunately, 'Capture_root::visible()' failed to apply the same logic. This patch makes 'visible()' consistent with 'bounding_box()'. It has the welcome effect that nitpicker remembers the pointer position during the dark phase. Fixes #5397 --- repos/os/src/server/nitpicker/main.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repos/os/src/server/nitpicker/main.cc b/repos/os/src/server/nitpicker/main.cc index 12e862158d..2772de0dc6 100644 --- a/repos/os/src/server/nitpicker/main.cc +++ b/repos/os/src/server/nitpicker/main.cc @@ -319,7 +319,10 @@ class Nitpicker::Capture_root : public Root_component [&] (Point const p) { _sessions.for_each([&] (Capture_session const &session) { if (!result && session.bounding_box().contains(p)) - result = true; }); }, + result = true; }); + if (!result) + result = _fallback_bounding_box.contains(p); + }, [&] (Nowhere) { }); return result; }