[Repo Assist] fix(tray): call EnableMouseInPointer(true) at startup for trackpad scroll#531
Conversation
…roll Fixes two-finger trackpad scroll not working in the WinUI tray app on cloud devboxes and RDP-backed sessions (issue #462). Root cause: on some cloud/VM environments the DirectManipulation input path is absent, so WinUI's default touchpad scroll routing is silently dropped. Calling user32 EnableMouseInPointer(true) before InitializeComponent() opts the process into the WM_POINTER codepath, which is handled correctly in those environments. Changes: - Add [DllImport("user32.dll")] EnableMouseInPointer P/Invoke - Call TryEnableMouseInPointer() in App() before InitializeComponent() - Log success/failure at startup (INFO/WARN level) - Honour OPENCLAW_DISABLE_MOUSE_IN_POINTER=1 env var as an opt-out Manually verified by shanselman on the affected devbox (#462 comment 2026-05-23): two-finger trackpad scrolling was restored; mouse wheel, clicks, hover, text fields, sliders, and window interactions showed no regressions. Closes #462 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-24 12:59 UTC / May 24, 2026, 8:59 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. for a reviewer with the affected Dev Box/RDP-style setup: open a scrollable tray surface on current main and try two-finger trackpad scroll. I did not reproduce it locally in this Linux read-only review, but current main lacks the proposed WM_POINTER opt-in and the linked issue has affected-session verification. PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused startup opt-in after maintainer acceptance of the process-wide input-routing change and final affected/unaffected Windows smoke coverage. Do we have a high-confidence way to reproduce the issue? Yes for a reviewer with the affected Dev Box/RDP-style setup: open a scrollable tray surface on current main and try two-finger trackpad scroll. I did not reproduce it locally in this Linux read-only review, but current main lacks the proposed WM_POINTER opt-in and the linked issue has affected-session verification. Is this the best way to solve the issue? Yes, the proposed change is the narrowest code path that matches the verified local fix. The maintainer choice is whether the default process-wide opt-in plus env opt-out is the right compatibility tradeoff. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ef6ac8acbab2. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Clockwork Test Hopper Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
🤖 This is an automated PR from Repo Assist.
What
Fixes two-finger trackpad scroll not working in the WinUI tray app on cloud devboxes and RDP-backed sessions.
Closes #462
Root Cause
On some cloud/VM environments (observed on Azure DevBox and RDP-backed sessions), the DirectManipulation input path used by WinUI 3's default scroll routing is absent. Without it, precision-touchpad
WM_POINTERevents are silently dropped, so two-finger scroll has no effect even though the same trackpad scrolls correctly in Edge/Chrome on the same machine.The Win32 API
EnableMouseInPointer(true)opts the process into theWM_POINTERcodepath for mouse/touchpad events. WinUI 3 apps running in these environments need this opt-in; desktop apps have it off by default.Fix
[DllImport("user32.dll")]P/Invoke forEnableMouseInPointerTryEnableMouseInPointer()called inApp()beforeInitializeComponent()so the opt-in is active before any WinUI window is createdOPENCLAW_DISABLE_MOUSE_IN_POINTER=1provides a regression-testing opt-outManual Verification
Shanselman applied this patch locally and confirmed in the affected dev box / RDP-style session (see comment on #462):
Suggested final test before merging:
OPENCLAW_DISABLE_MOUSE_IN_POINTER=1to confirm the issue returns in an affected environmentTest Status
build.ps1requires Windows and could not be run in CI.dotnet buildonOpenClaw.Shared.TestsandOpenClaw.Tray.Testssucceeds. Tests show 8 pre-existing failures in Shared and 10 in Tray (identical to master baseline) — no new failures introduced by this change.