Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions matrixbox_simulator/device/cpstubs/framebufferio.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def refresh(
self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1
) -> None:
group = self.root_group
if group is None or getattr(group, "hidden", False):
if group is None:
return

# Skip everything, pacing sleep included, when nothing's changed
Expand All @@ -127,7 +127,12 @@ def refresh(
time.sleep(1.0 / _refresh_fps)

canvas = bytearray(self.width * self.height * 3)
_composite(group, canvas, self.width, self.height, 0, 0)

# A hidden root group composites nothing, same as real hardware:
# refresh() still pushes a fresh (all-black) framebuffer rather
# than leaving whatever was last on screen in place.
if not getattr(group, "hidden", False):
_composite(group, canvas, self.width, self.height, 0, 0)

# Some sizes ship with their panel physically mounted rotated in
# the enclosure, which real firmware's own rotation default
Expand Down