mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 13:26:27 +00:00
nitpicker: restore Capture::Session::screen_size
Since #5352, the 'screen_size' RPC function returns a rectangle clipped against the client's bounding box, which unfortunately prevents screen-capturing applications from determining the actual screen size. This patch restores the original behavior by clipping the panorama against client-specific constraints w/o clipping against the client's buffer size. Fixes #5365
This commit is contained in:
parent
7e9c1ca3ca
commit
f30bbb1472
@ -203,7 +203,12 @@ class Nitpicker::Capture_session : public Session_object<Capture::Session>
|
||||
|
||||
Area screen_size() const override
|
||||
{
|
||||
return Rect::intersect(_view_stack.bounding_box(), bounding_box()).area;
|
||||
Rect const panorama = _view_stack.bounding_box();
|
||||
Rect const policy { _anchor_point(),
|
||||
{ .w = _policy.w.or_default(panorama.w()),
|
||||
.h = _policy.h.or_default(panorama.h()) } };
|
||||
|
||||
return Rect::intersect(panorama, policy).area;
|
||||
}
|
||||
|
||||
void screen_size_sigh(Signal_context_capability sigh) override
|
||||
|
@ -292,6 +292,9 @@ class Nitpicker::Capture_root : public Root_component<Capture_session>
|
||||
},
|
||||
[&] { session.apply_policy(Policy::blocked()); }); });
|
||||
}
|
||||
|
||||
_sessions.for_each([&] (Capture_session &session) {
|
||||
session.screen_size_changed(); });
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user