Skip to content

winex11.drv: Fix mouse input for builds without XInput2#7

Open
jeremybernstein wants to merge 1 commit intoGameNative:proton_10.0from
jeremybernstein:jb/mouse_clipping
Open

winex11.drv: Fix mouse input for builds without XInput2#7
jeremybernstein wants to merge 1 commit intoGameNative:proton_10.0from
jeremybernstein:jb/mouse_clipping

Conversation

@jeremybernstein
Copy link
Copy Markdown

Summary

Updates the dlls_winex11_drv_mouse_c.patch to fix mouse input in builds compiled without XInput2 support (e.g. Android/Termux X11 with --without-xinput2).

This builds on @Smuger's work in #6, which identified that SEND_HWMSG_NO_RAW must not be used when XInput2 is unavailable, since there is no explorer.exe raw input pipeline to generate WM_INPUT centrally.

Changes

  • WM_INPUT generation fix (credit: @Smuger / Suggestion for fixing the Proton 9 -> Proton 10 mouse input corruption #6): Add get_send_mouse_flags() helper that returns SEND_HWMSG_NO_RAW when XInput2 is available, or 0 when absent, so each process generates its own WM_INPUT messages
  • Relative motion synthesis: When a game requests cursor clipping but XInput2 is unavailable, synthesize relative mouse motion via warp-to-center in X11DRV_MotionNotify instead of refusing to clip
  • Compile-without-xinput2 fix: Remove the #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H guard around grab_clipping_window() so clipping works in no-XInput2 builds
  • Android XFixes workaround: Skip pXFixesHideCursor/pXFixesShowCursor calls on Android (crashes on Termux X11)

Problem

Without XInput2, upstream Wine refuses cursor clipping entirely, which breaks mouse look/camera control in games. The previous patch only had the XFixes workaround. This extends it with proper relative motion support.

Test plan

  • Tested on ARM64 Android (Termux X11) with cursor-clipping games
  • Verified WM_INPUT generation works in captured cursor mode
  • Verified stale warp events are properly filtered

Update dlls_winex11_drv_mouse_c.patch with relative motion synthesis
and WM_INPUT generation fix for no-XInput2 builds (Android/Termux).

Based on Smuger's WM_INPUT fix from PR GameNative#6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant