GNOME Bugzilla – Bug 736121
gdk smooth scroll event unit inconsistencies between backends
Last modified: 2018-04-15 00:01:31 UTC
Currently, the units of smooth scroll event deltas are not consistent between backends. Whereas for xi2, the units are somehow abstract, for backends such as quartz the units are actually in pixels/points. The GtkScrolledWindow and GtkRange, which support smooth scrolling, assume that deltas are always in abstract units as those of the xi2 backend. For quartz, this means that deltas which were already in pixel units, get magnified which in turn leads to very fast (unusable) scrolling. Since it does not seem possible to make the actual unit of the delta values consistent, Carlos has suggested an API addition to GdkEvent: gboolean gdk_event_scroll_get_view_deltas (GdkEventScroll *event, const GdkRectangle *rect, gdouble *delta_x, gdouble *delta_y); This would move the logic of interpreting the delta_x/delta_y in "event", with respect to a viewing area "rect" from the widgets to the gdk backends.
Created attachment 285483 [details] [review] scrolling: interpret smooth deltas as pixels on quartz This is a temporary workaround for scrolling units being amplified on quartz, due to the assumption that smooth scrolling deltas are always in some abstract unit similar to the one from xi2. A proper solution for the situation is described in bug #736121, but since we are close to release, this patch solves the issue temporarily.
Comment on attachment 285483 [details] [review] scrolling: interpret smooth deltas as pixels on quartz Given timing restrictions, IMO that patch is fine for the time being. Thinking a bit more about the API proposal, internally this should probably be a GdkDeviceClass vfunc, with a default fallback to gdk_event_scroll_get_deltas() (eg. assuming units are pixels). I actually think X11 is the odd backend here...
I reported the same issue in https://bugzilla.gnome.org/show_bug.cgi?id=724559 and also provided patch for fixing. The patch is not something to be proud about, but at least it works on my system.
(In reply to comment #3) > I reported the same issue in https://bugzilla.gnome.org/show_bug.cgi?id=724559 > and also provided patch for fixing. The patch is not something to be proud > about, but at least it works on my system. Oh, sorry that your patch went unnoticed... since this bug has some extra/future items, I'll mark yours as a duplicate of this.
*** Bug 724559 has been marked as a duplicate of this bug. ***
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new