From 01b82edc232bbf583b259edf8ed93e3c46831d82 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 24 Sep 2026 17:49:07 -0400 Subject: [PATCH] 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 --- src/display_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/display_manager.py b/src/display_manager.py index a15ce448..e88dca1b 100644 --- a/src/display_manager.py +++ b/src/display_manager.py @@ -725,7 +725,10 @@ class DisplayManager: @property def _capture_mode_active(self) -> bool: """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 def _capture_mode_active(self, value: bool) -> None: