6bdd276d05
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
49 lines
2.1 KiB
Diff
49 lines
2.1 KiB
Diff
From a4e5fe549e5497a7e5ae7eecae4fc654330500f2 Mon Sep 17 00:00:00 2001
|
|
From: Kristian Rietveld <kris@lanedo.com>
|
|
Date: Fri, 28 Sep 2012 06:18:49 +0200
|
|
Subject: [PATCH 22/68] Use start/end phase in event handling
|
|
|
|
Should make things work better on Mountain Lion.
|
|
---
|
|
gtk/gtkscrolledwindow.c | 13 +++++--------
|
|
1 file changed, 5 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
|
|
index 5341b50..92e75a0 100644
|
|
--- a/gtk/gtkscrolledwindow.c
|
|
+++ b/gtk/gtkscrolledwindow.c
|
|
@@ -2010,12 +2010,10 @@ gtk_scrolled_window_scroll_event (GtkWidget *widget,
|
|
if (old_overshoot_x != 0 || old_overshoot_y != 0)
|
|
is_overshot = TRUE;
|
|
|
|
- /* In case the view is not overshot, no snap back is active
|
|
- * and this event is not a momentum event, then a new scrolling
|
|
- * gesture has started. In case we are still in snapping back
|
|
- * state we can reset this (because the snapback has ended).
|
|
+ /* If a new gesture has started, reset snap back state.
|
|
+ * FIXME: check if overshoot has really ended.
|
|
*/
|
|
- if (!is_overshot && priv->deceleration_id == 0 && !is_momentum_event)
|
|
+ if (event->phase == GDK_EVENT_SCROLL_PHASE_START)
|
|
priv->is_snapping_back = FALSE;
|
|
|
|
/* Scroll events are handled in two cases:
|
|
@@ -2109,13 +2107,12 @@ gtk_scrolled_window_scroll_event (GtkWidget *widget,
|
|
_gtk_scrolled_window_allocate_overshoot_window (scrolled_window);
|
|
|
|
/* In two cases we want to start snapping back:
|
|
- * 1) The view is overshot and the gesture has ended (signalled
|
|
- * by an event with both deltas set to zero.
|
|
+ * 1) The view is overshot and the gesture has ended.
|
|
* 2) The view is overshot and we receive a momentum event, which
|
|
* also signals that the user's gesture has ended.
|
|
*/
|
|
if (is_overshot &&
|
|
- ((delta_x == 0.0 && delta_y == 0.0) || is_momentum_event))
|
|
+ (event->phase == GDK_EVENT_SCROLL_PHASE_END || is_momentum_event))
|
|
start_snap_back = TRUE;
|
|
|
|
/* If we should start a snap back and no current deceleration
|
|
--
|
|
1.7.10.2 (Apple Git-33)
|