Skip to content

Send a scroll's axis source after the axis - #141

Open
Unayung wants to merge 2 commits into
omacom:mainfrom
Unayung:fix/axis-source-order
Open

Unayung wants to merge 2 commits into
omacom:mainfrom
Unayung:fix/axis-source-order

Conversation

@Unayung

@Unayung Unayung commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #112.

Problem

The server's virtual pointer sent axis_source before axis. Hyprland (checked on v0.57.2, src/protocols/VirtualPointer.cpp) builds a fresh axis event with the wheel as its source on every axis request, and setAxisSource writes into m_axisEvents[m_axis], the event of the last axis named. A source sent first was dropped, or landed on the other axis after a change of direction. A touchpad scroll from the client reached the remote as a wheel with no discrete value: no kinetic scrolling, and mouse_up/mouse_down binds fired during a touchpad scroll.

Fix

Send axis_source after axis / axis_discrete / axis_stop and before frame(), as proposed in the issue. axis_discrete and axis_stop keep the event's source in Hyprland, so the wheel path behaves as before.

Testing

scripts/check.sh passes. New test thread::tests::axis_source_follows_the_axis decodes the pointer's requests from a socket peer and checks axis / axis_discrete / axis_stop, then axis_source, then frame, on both axes. With the old order it fails ([5, 3, 4] against [3, 5, 4]). To share the socket setup with the keyboard test, requests now decodes every request and key_requests filters it.

I checked the ordering against Hyprland's source but did not verify it live: nothing on one machine reports which axis source a remote app receives. I did not run scripts/e2e.sh, since this doesn't touch the video path.

The change was written with Claude Opus 5.5.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UCs6nfZCNssaXtUYR7cpHg

Hyprland starts a fresh axis event, with the wheel as its source, on
every virtual pointer `axis` request, and `axis_source` writes into the
event of the last axis named. Sent first, the source was dropped, so a
touchpad scroll reached the remote as a wheel: no kinetic scrolling, and
mouse_up/mouse_down binds fired while scrolling.

Fixes omacom#112.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCs6nfZCNssaXtUYR7cpHg
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues remain.

Summary

Sends axis_source after the scroll request and before frame, so Hyprland applies the source to the intended axis.

  • Remote scrolls now keep their finger or wheel source.

Reviews (2) · Last reviewed commit: "Test that a scroll's axis source follows..." · Reviewed by Greptile

Comment thread crates/hypr-input/src/thread.rs Resolved
The input thread's socket test decodes every request now, not only key
requests, so the pointer's request order can be checked: the source after
axis, axis_discrete and axis_stop, then frame, on either axis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCs6nfZCNssaXtUYR7cpHg
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.

Touchpad scroll reaches Hyprland as a wheel (axis_source sent before axis)

1 participant