mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-10 17:16:36 +00:00
fix(display): capture-mode check tolerates a DisplayManager built without __init__
main's new test_display_manager_logging builds one with object.__new__; set_scrolling_state here asks whether the thread is capturing, which read the per-thread state __init__ creates. Read it the way _current_surface() already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -725,7 +725,10 @@ class DisplayManager:
|
|||||||
@property
|
@property
|
||||||
def _capture_mode_active(self) -> bool:
|
def _capture_mode_active(self) -> bool:
|
||||||
"""True while the calling thread is capturing content off-screen."""
|
"""True while the calling thread is capturing content off-screen."""
|
||||||
return getattr(self._capture_state, 'active', False)
|
# Read like _current_surface(): a DisplayManager built without
|
||||||
|
# __init__ (tests do) has no per-thread state, and captures nothing.
|
||||||
|
state = self.__dict__.get('_capture_state')
|
||||||
|
return getattr(state, 'active', False) if state is not None else False
|
||||||
|
|
||||||
@_capture_mode_active.setter
|
@_capture_mode_active.setter
|
||||||
def _capture_mode_active(self, value: bool) -> None:
|
def _capture_mode_active(self, value: bool) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user