Hello everyone! This is my first post on this forum so apologize if its in wrong category.
I developing kiosk app using SWT running on Linux. I was forced to switch underling backend from GTK 2.0 to GTK 3.0 on Ubuntu 22.04
Almost everything works fine, almost…
I’ve my custom event listeners for swipe, drag, scroll long press etc… On GTK 2.0 it was ok, on GTK 3.0 scrolling is choppy and random click events are generated.
After many hours of reading docs and debugging I font GtkInspector. I’ve found out that SWT ScrolledComposite is wrapped around GtkScrolledWindow and the “built-in” touch support is problematic.
GtkScrolledWindow property named “kinetic-scrolling” is causing troubles. This property is set automatically on systems with detected touchscreen through variable(?) GDK_SOURCE_TOUCHSCREEN.
Is there a way to set this property to false in css theme file? Maybe i can somehow switch input device with xinput/xorg.conf to disable touchscreen detection?
I’d recommend you ask on an SWT support forum, because this seems to be an issue with their library.
The main difference between GTK2 and GTK3 is that the latter is using XInput2 by default; what might have happened is that the older version of SWT was using pointer emulation to fake a pointer from the touchscreen, whereas now the widget is getting real events from the touchscreen and getting confused.
GtkScrolledWindow most definitely works fine with touch devices, so I’d check with SWT first.
But kinetic scrolling is just the code that accumulates scrolling to increase the speed, and animates the scroll once you “let go” of the touch screen.
If you’re doing your own event handling because of GTK2, then you might want to stop doing that: GTK3 has a better set of gesture recognisers built into it.