diff --git a/lib/display_driver.py b/lib/display_driver.py index 72f23c8..5a2db7e 100644 --- a/lib/display_driver.py +++ b/lib/display_driver.py @@ -1660,9 +1660,18 @@ def _flush_cb_direct(self, disp_drv, area, color_p): ) except Exception: synced = False - if last and not synced: + if last: + # The frame is out: by show() when flush_rect could not sync it, + # otherwise flush_rect already did and frame_done() says so (a + # no-op unless the panel's measure_fps is on). Either way it is + # one present, however many areas it took. try: - panel.show() + if synced: + frame_done = getattr(panel, "frame_done", None) + if frame_done is not None: + frame_done() + else: + panel.show() self.presents += 1 except Exception: pass