[gtk+] GtkScrolledWindow: Always uninstall scroll cursor when starting deceleration
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkScrolledWindow: Always uninstall scroll cursor when starting deceleration
- Date: Wed, 27 Jul 2016 18:30:48 +0000 (UTC)
commit 9eb356d9f29a881e05937a0089d88154cfc6364a
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jul 27 20:19:30 2016 +0200
GtkScrolledWindow: Always uninstall scroll cursor when starting deceleration
It could be the case that the last scroll event is received long after any
previous scroll event, in this case the last scroll event discards all "old"
scroll events, and scroll_history_finish() returns FALSE because there's no
time/offset deltas in the scroll history.
This is desired so we don't trigger the deceleration effect if there was no
effective velocity, we still must reset the installed scroll cursor, so take
it out of this if() condition.
gtk/gtkscrolledwindow.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index df7302c..17f25e0 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -3503,12 +3503,12 @@ gtk_scrolled_window_scroll_event (GtkWidget *widget,
priv->scroll_events_overshoot_id = 0;
}
+ if (start_deceleration)
+ uninstall_scroll_cursor (scrolled_window);
+
if (start_deceleration &&
scroll_history_finish (scrolled_window, &vel_x, &vel_y))
- {
- uninstall_scroll_cursor (scrolled_window);
- gtk_scrolled_window_decelerate (scrolled_window, vel_x, vel_y);
- }
+ gtk_scrolled_window_decelerate (scrolled_window, vel_x, vel_y);
else if (_gtk_scrolled_window_get_overshoot (scrolled_window, NULL, NULL))
{
priv->scroll_events_overshoot_id =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]