mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-26 19:47:42 +00:00
Emulate macOS relative mouse mode in the X11 backend and skip redundant cursor updates
CGAssociateMouseAndMouseCursorPosition(false) used to warp the pointer to the window center, freeze the reported position there and treat the game's own CGWarpMouseCursorPosition calls as motion. On Xwayland, which ignores warps while the cursor is visible, this left League's cursor stuck in the middle. The backend now keeps a frozen virtual cursor: physical motion only produces deltas (deltaY positive downwards), application warps move the virtual cursor and their echoes are dropped, mouseLocation returns it, and the pointer is only warped back where the server honours warps. The grab no longer uses the invalid FocusChangeMask and is released and retaken across focus changes. setCursor: no longer re-sends XDefineCursor/XFlush when the window already has that cursor; League set it about 190 times per second. Also carries the opt-in input trace (/tmp/rclol-input-trace in the guest). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
937e632bcf
commit
70fd5fdebd
3 files changed
+1022
-70
No files matched your search
@@ -230,6 +230,10 @@ These are host settings, not game settings. Run on AC power, and use a performan
|
||||
|
||||
The X11 backend previously called `XSync` after every cursor-shape update, waiting for an X server reply on the input thread. It now uses `XFlush` to send the change immediately without waiting. This removes an avoidable round trip during cursor updates. A local manual retest on 2026-10-16 found that the mouse problem no longer occurred with VSync enabled. Input-to-display latency has not been measured, and confirmation from the original reporter is still pending. Rebuild and install with `./scripts/update.sh` after exiting the game and both clients.
|
||||
|
||||
A later input trace showed League setting the cursor about 190 times and unhiding it about 100 times per second, each time sending the same cursor to the X server. The backend now skips the update when the window already has that cursor. The effect on latency has not been measured.
|
||||
|
||||
The backend's relative mouse mode (`CGAssociateMouseAndMouseCursorPosition(false)`) previously warped the pointer to the window center, treated the game's own cursor warps as motion and reported `deltaY` upside down. It now follows macOS: the cursor stays where it is, events carry the physical motion as deltas (positive `deltaY` downwards, also for ordinary motion), the game's warps move the cursor without a delta, and `+[NSEvent mouseLocation]` returns that cursor. On Xwayland a warp takes effect only while the cursor is hidden, so with a visible cursor the pointer is not held in place. `tools/test-x11-relative-mouse.c` checks this logic on the host (`cc tools/test-x11-relative-mouse.c && ./a.out` after `scripts/prepare.py`). League on the tested Hyprland setup never enters this mode, so it has not been confirmed in game.
|
||||
|
||||
For a manual comparison, keep the scene, FPS cap, display refresh and compositor settings the same. Record whether the delay affects the cursor itself, camera movement, or actions after clicking, and compare the in-game VSync setting on and off. Include the desktop/compositor, X11 or Xwayland session, GPU/driver, monitor refresh and fullscreen/windowed mode in the report. Do not automate game input. The fullscreen cursor-shape problem below is a separate known symptom.
|
||||
|
||||
## Cursor stops changing shape in fullscreen
|
||||
|
||||
Reference in new issue
Block a user