From 08bf219b28dc4281263392843fc050255e638a87 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 22 Oct 2024 17:48:00 +0200 Subject: [PATCH] nitpicker: apply domain constraints to GUI info If a is constrained by 'width' or 'height' attributes, clip the capture rects of the panorama info reported to the client. So the client observes the constraint as window size. Issue #5356 --- repos/os/src/server/nitpicker/capture_session.h | 4 ++-- repos/os/src/server/nitpicker/main.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/os/src/server/nitpicker/capture_session.h b/repos/os/src/server/nitpicker/capture_session.h index c71f852b42..b591506358 100644 --- a/repos/os/src/server/nitpicker/capture_session.h +++ b/repos/os/src/server/nitpicker/capture_session.h @@ -183,11 +183,11 @@ class Nitpicker::Capture_session : public Session_object _policy_changed = true; } - void gen_capture_attr(Xml_generator &xml) const + void gen_capture_attr(Xml_generator &xml, Rect const domain_panorama) const { xml.attribute("name", label()); - gen_attr(xml, bounding_box()); + gen_attr(xml, Rect::intersect(domain_panorama, bounding_box())); unsigned const w_mm = _policy.w_mm.or_default(_buffer_attr.mm.w), h_mm = _policy.h_mm.or_default(_buffer_attr.mm.h); diff --git a/repos/os/src/server/nitpicker/main.cc b/repos/os/src/server/nitpicker/main.cc index 2f5dfc9805..2a241f377d 100644 --- a/repos/os/src/server/nitpicker/main.cc +++ b/repos/os/src/server/nitpicker/main.cc @@ -361,7 +361,7 @@ class Nitpicker::Capture_root : public Root_component { gen_attr(xml, domain_panorama); _sessions.for_each([&] (Capture_session const &capture) { - xml.node("capture", [&] { capture.gen_capture_attr(xml); }); }); + xml.node("capture", [&] { capture.gen_capture_attr(xml, domain_panorama); }); }); } };