Our custom scroll handler for horizontal (Shift+Scroll) and page (Alt+Scroll) scroll didn't properly check the scroll direction and assume that if it's not down it's up. This was mostly not a problem because the other types only were left and right scroll events, which are a lot less common.
However, it became a lot more problematic with GTK 3.4 that introduced "smooth scrolling", and thus a new scroll type that can happen for events in any direction. We then would scroll up (as we assume "not down" is up) regardless of the actual direction of the event.
It's still not clear why we'd get smooth scroll events on X11 as no code I can find asks for it and we generally don't get those, but sometimes a Scintilla widget starts receiving them, leading to the bug. On Wayland on the other hand, Scintilla asks for smooth scroll events, so we need to have a fix for it in any case. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1843
-- Commit Summary --
* Fix horizontal and page scroll on GTK3
-- File Changes --
M src/editor.c (4)
-- Patch Links --
https://github.com/geany/geany/pull/1843.patch https://github.com/geany/geany/pull/1843.diff
Seems sensible, but can't test it fixes it since it isn't broken here.
@elextr I also don't get the issue when I start Geany, but sometimes after some undetermined events or actions, it starts to appear. I can only tell that it works for me because I've been playing randomly around adding a debug statement to know when receiving those weird events, and seen it starting to appear when it started getting buggy, and not anymore after the fix (well, getting the debug messages but not the bug anymore).
@b4n, maybe its a function of your GTK version, it never seems to happen here, (3.18.9) although I usually don't spend all day trying scrolling :)
@elextr maybe, but as said it seems pretty random, and I had a hard time reproducing it after starting a fresh Geany, so who knows. But yeah it might be a bug in GTK somewhere, because I really couldn't find anywhere why we'd start getting smooth scroll events.
Seems OK to me, maybe it will fix my [random flashing horizontal scrollbar issue](https://github.com/geany/geany/issues/1717) too :)
kugel- approved this pull request.
LGBI
@b4n, looks like nobody else is able to test it, might as well commit it?
Merged #1843.
github-comments@lists.geany.org