skyjake / lagrange

A Beautiful Gemini Client
https://gmi.skyjake.fi/lagrange/
BSD 2-Clause "Simplified" License
1.19k stars 62 forks source link

Scroll wheel does not function under Wayland hw rendering #612

Open kiefac opened 1 year ago

kiefac commented 1 year ago

(Possibly related to #605?) I am running the AUR package on KDE/KWin-wayland. Lagrange seems to be forced into very laggy software rendering to XWayland, so I set the SDL_VIDEODRIVER env var to wayland to see if it would smooth things out. While it does make Lagrange much smoother and more comfortable to use, it has the unfortunate side effect of making the scroll wheel do absolutely nothing, even in the preferences menu. Arrow keys and PgUp/Dn still function to scroll the page. Ctrl-- and Ctrl-= still function to zoom. Scroll wheel still functions in every other application, of course. I would assume this was some SDL-specific issue, but a quick google for "sdl wayland scroll wheel" doesn't appear to bring up anything relevant. Also, the scroll wheel works in Steam, which also uses SDL, when running with the same environment variable change.

rnb42 commented 1 year ago

Same issue here on sway version 1.8.1 under Voidlinux

jtietema commented 9 months ago

Same issue with the flatpak version on Fedora 38 (Gnome edition on Wayland)

tuomovee commented 7 months ago

Are you possibly using multiple displays? Does the scrolling work if you move the Lagrange window to 0,0 on your leftmost display? I encountered a similar issue on KWin Wayland session and this seems to be related to coord_MouseWheelEvent() and how SDL_GetGlobalMouseState() and SDL_GetWindowPosition() misbehave under Wayland. I don't know the Lagrange codebase enough to say what are the adverse effects for this but removing the check for mousewheel event coordinates in dispatchEvent_Window() seems to allow the scrollwheel event to be processed despite SDL being bonkers under Wayland.

maxgira commented 6 months ago

This issue still persists in Fedora 39, with a GNOME Wayland session, both with the RPM package from the Fedora repos as well as the flatpak version. I can also confirm as mentioned by @tuomovee that scrolling does work on one of my monitors. I would greatly appreciate this issue getting fixed, as Lagrange is an otherwise great Gemini browser.

probablySophie commented 3 months ago

I've made PR #669 Which I think solves the issue?

skyjake commented 3 weeks ago

Dev branch has a possible fix, although it requires SDL 2.26 or newer. Please give it a test...