Multitouch review 3: kinetic scrolling



API
  GTK_KINETIC_SCROLLING_{NONE,ENABLED,CAPTURE_BUTTON_PRESS}
  GtkScrolledWindow::kinetic-scrolling property

Not much API here. Kinetic scrolling is enabled by setting the
kinetic-scrolling property on the scrolledwindow. You can also add the
CAPTURE_BUTTON_PRESS flag to that property to opt into the event
storage/release that we've discussed earlier. This is to prevent a
button press from triggering an irreversible action before it is known
if it was just the beginning of a scrolling swipe. Kinetic scrolling
and button capture are turned on by default.

Implementation-wise, kinetic scrolling only affects touch devices.
Overshooting is also implemented using an extra, intermediate window.
One of the limitations of the overshooting implementations is that the
scrollbars do not 'bounce'. The deceleration function is hardcoded.

Questions, comments:

- Restricting kinetic scrolling to touch devices is correct,
experience-wise, but it makes testing harder. Could we have some debug
mode ?

- The documentation of CAPTURE_BUTTON_PRESS states that
  "This flag should be enabled if the child widget(s) perform
non-reversible actions on #GtkWidget::button-press-event. If the
widget does not do so, and handles #GtkWidget::grab-broken-event, it
might be better off without this flag."
  Are there any concrete use cases where this flag needs to be turned
off for best results ? If not, could we get away with just always
turning it on ?

- Do we need some knob to allow tweaking the 'bouncyness' ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]