After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736121 - gdk smooth scroll event unit inconsistencies between backends
gdk smooth scroll event unit inconsistencies between backends
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
3.13.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Carlos Garnacho
: 724559 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-09-05 11:33 UTC by jessevdk@gmail.com
Modified: 2018-04-15 00:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scrolling: interpret smooth deltas as pixels on quartz (2.31 KB, patch)
2014-09-05 11:41 UTC, jessevdk@gmail.com
committed Details | Review

Description jessevdk@gmail.com 2014-09-05 11:33:18 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.
Comment 1 jessevdk@gmail.com 2014-09-05 11:41:17 UTC
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 2 Carlos Garnacho 2014-09-05 12:00:43 UTC
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...
Comment 3 andriusr 2014-09-05 17:26:13 UTC
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.
Comment 4 Carlos Garnacho 2014-09-06 08:18:30 UTC
(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.
Comment 5 Carlos Garnacho 2014-09-06 08:19:11 UTC
*** Bug 724559 has been marked as a duplicate of this bug. ***
Comment 6 Matthias Clasen 2018-02-10 04:56:27 UTC
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.
Comment 7 Matthias Clasen 2018-04-15 00:01:31 UTC
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