lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Scroll wheel does not function under Wayland hw rendering

Open kiefac opened this issue 2 years ago • 6 comments

(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.

kiefac avatar Aug 01 '23 02:08 kiefac

Same issue here on sway version 1.8.1 under Voidlinux

rnb42 avatar Aug 13 '23 09:08 rnb42

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

jtietema avatar Nov 30 '23 21:11 jtietema

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.

tuomovee avatar Feb 01 '24 12:02 tuomovee

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.

maxgira avatar Mar 26 '24 00:03 maxgira

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

probablySophie avatar Jun 05 '24 04:06 probablySophie