Skip to content

fix: scroll wheel lag and missing horizontal scroll on Windows#156

Open
stefanverleysen wants to merge 2 commits intosymless:masterfrom
stefanverleysen:fix/scroll-wheel-lag
Open

fix: scroll wheel lag and missing horizontal scroll on Windows#156
stefanverleysen wants to merge 2 commits intosymless:masterfrom
stefanverleysen:fix/scroll-wheel-lag

Conversation

@stefanverleysen
Copy link

Summary

  • Smooth-scroll mice (Logitech, etc.) generate 100+ wheel events per second,
    causing cascading input lag that freezes the client
  • Horizontal scroll was never captured or injected on Windows

Changes

  • Compress wheel events the same way mouse motion is already compressed
  • Make wheel injection non-blocking (was waiting for a round-trip per tick)
  • Capture and inject horizontal scroll (WM_MOUSEHWHEEL / MOUSEEVENTF_HWHEEL)

To test

  1. Connect a smooth-scroll mouse (e.g. Logitech MX Master) to the server
  2. Move cursor to a client machine
  3. Scroll quickly in a long document -- should be smooth with no lag or freezing
  4. Tilt the scroll wheel sideways (horizontal scroll) in a wide spreadsheet
    or horizontally-scrollable page -- should scroll horizontally
  5. Repeat with a standard notched-wheel mouse to confirm no regression

stefanverleysen and others added 2 commits February 12, 2026 11:38
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Scroll events blocked on a synchronous round-trip to the desktop thread
per tick. Smooth-scroll mice (100+ events/sec) caused cascading lag that
froze the client. Additionally, horizontal scroll (WM_MOUSEHWHEEL) was
never captured.

- Add scroll event compression in ServerProxy (accumulate deltas when
  stream has buffered data, same pattern as mouse move compression)
- Make fakeMouseWheel non-blocking (fire-and-forget to desktop thread)
- Capture WM_MOUSEHWHEEL in LL hook, inject via MOUSEEVENTF_HWHEEL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nbolton
Copy link
Member

nbolton commented Mar 2, 2026

I think I might also be seeing this (Linux server), I'll test to see if this fixes it.

Edit: Though the horizontal scroll was fixed upstream (deskflow/deskflow#9438) I'm not sure about the scroll skipping bug.

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.

2 participants