mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-20 17:11:45 +00:00
nitpicker: enhance fallback bounding box check
Solely consider sessions with valid bounding boxes for the decision to use the fallback bounding box or not. New started capture clients may require some time between capture session creation and actually capture screen creation at which the bounding box becomes valid. Issue #5521
This commit is contained in:
parent
9e96947ae9
commit
856c48e1a1
@ -299,12 +299,16 @@ class Nitpicker::Capture_root : public Root_component<Capture_session>
|
||||
|
||||
void _for_each_session_bb(auto const &fn) const
|
||||
{
|
||||
bool any_session_exists = false;
|
||||
_sessions.for_each([&] (Capture_session const &session) {
|
||||
any_session_exists = true;
|
||||
fn(session.bounding_box()); });
|
||||
bool any_valid_bounding_box_exists = false;
|
||||
|
||||
if (!any_session_exists)
|
||||
_sessions.for_each([&] (Capture_session const &session) {
|
||||
auto const bounding_box = session.bounding_box();
|
||||
if (bounding_box.valid())
|
||||
any_valid_bounding_box_exists = true;
|
||||
fn(bounding_box);
|
||||
});
|
||||
|
||||
if (!any_valid_bounding_box_exists)
|
||||
fn(_fallback_bounding_box);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user