Add auto-initialization to MSS and DXcam engines to fix WGC multi-monitor issue

- MSS and DXcam now auto-initialize on first capture_display() call, matching WGC behavior
- Remove engine.initialize() call from test endpoint to prevent WGC from initializing monitor 0 unnecessarily
- This fixes the issue where testing WGC with secondary monitor would show borders on both displays

Previously, calling engine.initialize() would initialize WGC's monitor 0 by default, then capture_display() would initialize the requested monitor, causing both to be active. Now all engines consistently auto-initialize only when needed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-09 19:25:45 +03:00
parent fdb73c9fc9
commit b5545d3198
3 changed files with 5 additions and 6 deletions

View File

@@ -930,9 +930,8 @@ async def test_template(
)
)
# Create and initialize engine
# Create engine (auto-initializes on first capture)
engine = EngineRegistry.create_engine(test_request.engine_type, test_request.engine_config)
engine.initialize()
# Run sustained capture test
logger.info(f"Starting {test_request.capture_duration}s capture test with {test_request.engine_type}")