Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland: Mouse only scrolls up #1146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

neonbyte1
Copy link

I encountered a problem with the mouse scrolling when switching from X11 + i3 to Wayland + Hyprland. At first I thought that this might be due to an outdated version of Looking Glass, as I was still using version B6 in my gaming VM. However, I performed a clean installation of my system last night, set up a new VM , but the problem was still there - even with the bleeding edge version.

Actual problem

I've noticed that the actual value of the value parameter in pointerAxisHandler is sometimes 0 while scrolling up or down. After looking at the implementation, you'll see why.

int button = value > 0 ?
  5 /* SPICE_MOUSE_BUTTON_DOWN */ :
  4 /* SPICE_MOUSE_BUTTON_UP */;
app_handleButtonPress(button);
app_handleButtonRelease(button);

Since the value is not greater than 0, the LookinGlass client will always handle the event as SPICE_MOUSE_BUTTON_UP.

Preview

https://i.imgur.com/A7eGpMb.mp4

Logs

Serial: 7067714, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067716, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067717, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067719, Axis: 0, Value: 3840, Double: 15.000000
Serial: 7067720, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067722, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067724, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067729, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067732, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067737, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067740, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067743, Axis: 0, Value: 3840, Double: 15.000000
Serial: 7067808, Axis: 0, Value: -3840, Double: -15.000000
Serial: 7067810, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067812, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067814, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067818, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067829, Axis: 0, Value: -3840, Double: -15.000000
Serial: 7067895, Axis: 0, Value: 3840, Double: 15.000000
Serial: 7067898, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067902, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067904, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067907, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067909, Axis: 0, Value: 3840, Double: 15.000000
Serial: 7067910, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067912, Axis: 0, Value: 0, Double: 0.000000
Serial: 7067976, Axis: 0, Value: -3840, Double: -15.000000

Solution

I've added an OR statement to the condition so that the events are only processed if the value is not 0.

@gnif
Copy link
Owner

gnif commented Dec 17, 2024

Have you reported this as a bug to the Hyperland devs? A scroll value of 0 should really never be seen, it's a useless event.

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