Repository navigation
refactor: extract StartupInputConfigurator from App.xaml.cs - #606
Conversation
Move the mouse-in-pointer startup configuration out of the App constructor into a dedicated StartupInputConfigurator helper. The P/Invoke declarations, the OPENCLAW_DISABLE_MOUSE_IN_POINTER guard, the env-var parsing and the configuration logic all move together; the constructor now calls StartupInputConfigurator.Configure() in the same spot, before InitializeComponent(), preserving startup ordering. Pure extraction, no behavior change. Logging strings, guard order, captured values and caught exceptions are identical to the original. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 6:30 PM ET / 22:30 UTC. Summary Reproducibility: not applicable. this is a refactor PR rather than a reported bug. Source inspection and the provided startup log are the relevant checks. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow extraction after CI or maintainer validation confirms the full repo build and shared/tray tests pass. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a refactor PR rather than a reported bug. Source inspection and the provided startup log are the relevant checks. Is this the best way to solve the issue? Yes; moving this self-contained startup input concern into a service while preserving the pre- AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against eb06fba21c44. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
App.xaml.csconfigured mouse-in-pointer input inline in its constructor:a P/Invoke pair, an env-var opt-out, and the enable logic that turns on
precision touchpad scrolling before WinUI starts. This moves that concern
into a dedicated
StartupInputConfigurator.What changed
Services/StartupInputConfigurator.cs— holds the mouse-in-pointerstartup configuration: the
EnableMouseInPointer/IsMouseInPointerEnabledP/Invokes, the
OPENCLAW_DISABLE_MOUSE_IN_POINTERopt-out, the truthy-envparsing, and the enable-and-verify logic.
App.xaml.cs— the constructor now callsStartupInputConfigurator.Configure()in the same spot, before
InitializeComponent(); the original private methodsand P/Invoke declarations are removed.
Pure extraction. The class is static with no App state: the moved code read
no instance fields, so nothing is passed in. Logging strings, guard order,
captured values, and caught exceptions (
DllNotFoundException,EntryPointNotFoundException,SEHException) are identical to the original.Testing
dotnet build src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj -r win-x64dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csprojNo new tests: this is a behavior-preserving move of process-wide input setup
that was not unit-tested before and is not behavior-changed here.
Proof
Manual run after the extraction. The configurator fires through the new type
on startup, before WinUI initialization, identical to the pre-refactor path:
Notes
No behavior change is intended. The seam (
Configure()beforeInitializeComponent()) and the enable-and-verify logic are preserved exactly.Addresses part of #554.
Co-Authored-By: Claude Opus 4.8 [email protected]