Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kinetic-scroll-view: Various fixes for the motion buffer #98

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Sep 22, 2015

  1. kinetic-scroll-view: Handle ClutterTimeline:stopped not :completed

    The former is always emitted when the timeline stops (either due to
    reaching its duration, or due to clutter_timeline_stop() being called);
    the latter is only emitted in the first case.
    
    Changing signals means we can eliminate manual cleanup code after calls
    to clutter_timeline_stop().
    
    clutter-project#98
    Philip Withnall committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    a3ea35b View commit details
    Browse the repository at this point in the history
  2. kinetic-scroll-view: Grow the motion buffer over time

    The motion buffer contains a history of motion events for the current
    scrolling action, starting from the initial touch event. This is used at
    the release of the scroll to work out an average origin coordinate,
    which is then used in the calculation of whether to use kinetic
    scrolling.
    
    Previously, the oldest entry in the motion buffer was removed if the
    buffer filled up, then the buffer was expanded in size. This meant that
    for scrolling actions with many motion events, the average taken over
    the events would quickly creep towards the location of the most recent
    motion event. This meant that, often, the threshold for starting a
    kinetic scroll was not reached, and hence kinetic scrolling would not
    happen.
    
    Stop removing the oldest entry from the buffer, and instead grow it
    indefinitely. This does make the widget prone to consuming all the
    system’s memory if the user scrolls around for a _very_ long time. This
    may be better fixed by calculating a moving average instead, and
    eliminating the motion buffer.
    
    clutter-project#98
    Philip Withnall committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    f1322a7 View commit details
    Browse the repository at this point in the history
  3. kinetic-scroll-view: Add more debug output

    Philip Withnall committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    66bf2f4 View commit details
    Browse the repository at this point in the history
  4. kinetic-scroll-view: Replace motion buffer with a moving average

    The motion buffer stored each motion event which happened in a sequence
    (for example, a single swipe) on the kinetic scroll view, in order that
    the average event coordinates and time could be computed at the end of
    the sequence (on releasing the touchscreen). This could lead to problems
    with very long event sequences — potentially allocating a huge event
    array and leading to allocation failure.
    
    Avoid that by computing the average of the events as they are received.
    
    clutter-project#98
    Philip Withnall committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    a5610ad View commit details
    Browse the repository at this point in the history
  5. kinetic-scroll-view: Use gint64 for timestamps rather than GTimeVal

    GTimeVal is a pain to use and the use of glong means the potential
    for overflow when summing several timestamps on 32-bit platforms is
    quite high. Instead, use gint64 and g_get_real_time().
    
    clutter-project#98
    Philip Withnall committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    50b91be View commit details
    Browse the repository at this point in the history
  6. kinetic-scroll-view: Include timestamps in debug messages

    This makes debugging problems in the MxKineticScrollView a lot easier.
    Note that _KINETIC_DEBUG must be defined to enable debug messages.
    
    clutter-project#98
    Philip Withnall committed Sep 22, 2015
    Configuration menu
    Copy the full SHA
    60fc20e View commit details
    Browse the repository at this point in the history