Touch drag scroll fix
In KGX there's an open issue in relation to scrolling being too fast on a touchscreen. This bug really bothered me so I did some digging into KGX, VTE and the GTK codebases and here's what I found:
GtkAdjustment
is used by GtkScrolledWindow
and the related GtkScrollbar
to implement scrolling. When the mouse is used to scroll the GtkAdjustment
is updated with a new value from Terminal::widget_mouse_scroll
, however when touch or the scrollbar are used the adjustment is updated by GTK and thus Terminal::vadjustment_value_changed
is called. The problem is that Terminal::m_vadjustment
uses rows as a unit. When the scrollbar is used this doesn't matter as the relative values are still the same, but when using touch the GtkAdjustment
is updated with absolute pixel values and thus every pixel moved by your finger scrolls a whole line in KGX.
I've attached a patch that fixes this by converting to/from pixel coordinates for the GtkAdjustment
. From testing the scrolling behavior when using a mouse doesn't get changed by this, only touch input.Make-GtkAdjustment-use-pixel-coordinates.patch
I haven't tested but this may also fix #234 (closed).