Skip to content
  • Alice Mikhaylenko's avatar
    eventcontrollerscroll: Fix the history push condition · 97f54062
    Alice Mikhaylenko authored
    Once upon a time, there was a function called gdk_event_get_scroll_deltas().
    It returned %TRUE when an event had scroll deltas and that was used as the
    condition to decide whether to push scroll deltas to the scroll history,
    even when the both deltas are 0 for the stop event at the end of scrolling.
    
    When GtkScrolledWindow kinetic scrolling code was adapted for
    GtkEventControllerScroll, it was replaced with a (dx != 0 && dy != 0)
    check. This prevented the stop event from getting into the history, and
    instead allowed non-smooth scrolling to affect the history as they have
    synthetic deltas with one of the values being -1 or 1 and the other on 0.
    
    Instead, check the direction as we already have it as a local variable.
    97f54062