diff --git a/repos/os/src/server/nitpicker/capture_session.h b/repos/os/src/server/nitpicker/capture_session.h index 48b0e02f4d..ea6cc6765e 100644 --- a/repos/os/src/server/nitpicker/capture_session.h +++ b/repos/os/src/server/nitpicker/capture_session.h @@ -165,9 +165,10 @@ class Nitpicker::Capture_session : public Session_object void mark_as_damaged(Rect rect) { _dirty_rect.mark_as_dirty(rect); - _wakeup_if_needed(); } + void process_damage() { _wakeup_if_needed(); } + void screen_size_changed() { if (_screen_size_sigh.valid()) diff --git a/repos/os/src/server/nitpicker/main.cc b/repos/os/src/server/nitpicker/main.cc index b0de908ba5..5a5993395d 100644 --- a/repos/os/src/server/nitpicker/main.cc +++ b/repos/os/src/server/nitpicker/main.cc @@ -348,6 +348,12 @@ class Nitpicker::Capture_root : public Root_component session.mark_as_damaged(rect); }); } + void process_damage() + { + _sessions.for_each([&] (Capture_session &session) { + session.process_damage(); }); + } + void report_displays(Xml_generator &xml, Rect const domain_panorama) const { gen_attr(xml, domain_panorama); @@ -524,7 +530,10 @@ struct Nitpicker::Main : Focus_updater, Hover_updater, void mark_as_dirty(Rect rect) { _dirty_rect.mark_as_dirty(rect); + } + void process_damage() + { if (_main._now().ms - _previous_sync.ms > 40) _handle_sync(); } @@ -641,6 +650,16 @@ struct Nitpicker::Main : Focus_updater, Hover_updater, } } + Signal_handler
_damage_handler { _env.ep(), *this, &Main::_handle_damage }; + + void _handle_damage() + { + if (_fb_screen.constructed()) + _fb_screen->process_damage(); + + _capture_root.process_damage(); + } + /** * View_stack::Damage interface */ @@ -650,6 +669,8 @@ struct Nitpicker::Main : Focus_updater, Hover_updater, _fb_screen->mark_as_dirty(rect); _capture_root.mark_as_damaged(rect); + + _damage_handler.local_submit(); } void _update_input_connection()