[gtk+/gestures: 81/92] longpress: fix reentrancy on ::reset()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gestures: 81/92] longpress: fix reentrancy on ::reset()
- Date: Tue, 8 Apr 2014 19:47:13 +0000 (UTC)
commit 66c9819b8f3bd5a90fa0f5776a4709fe4fc72ccb
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Apr 8 21:10:43 2014 +0200
longpress: fix reentrancy on ::reset()
gtk/gtkgesturelongpress.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkgesturelongpress.c b/gtk/gtkgesturelongpress.c
index 7263776..c833cea 100644
--- a/gtk/gtkgesturelongpress.c
+++ b/gtk/gtkgesturelongpress.c
@@ -130,9 +130,9 @@ gtk_gesture_long_press_update (GtkGesture *gesture,
{
if (priv->timeout_id)
{
- g_signal_emit (gesture, signals[CANCELLED], 0);
g_source_remove (priv->timeout_id);
priv->timeout_id = 0;
+ g_signal_emit (gesture, signals[CANCELLED], 0);
}
priv->cancelled = TRUE;
@@ -149,10 +149,9 @@ gtk_gesture_long_press_end (GtkGesture *gesture,
if (priv->timeout_id)
{
- if (!priv->triggered)
- g_signal_emit (gesture, signals[CANCELLED], 0);
g_source_remove (priv->timeout_id);
priv->timeout_id = 0;
+ g_signal_emit (gesture, signals[CANCELLED], 0);
}
priv->cancelled = priv->triggered = FALSE;
@@ -163,15 +162,8 @@ gtk_gesture_long_press_sequence_state_changed (GtkGesture *gesture,
GdkEventSequence *sequence,
GtkEventSequenceState state)
{
- GtkGestureLongPressPrivate *priv;
-
- priv = gtk_gesture_long_press_get_instance_private (GTK_GESTURE_LONG_PRESS (gesture));
-
if (state == GTK_EVENT_SEQUENCE_DENIED)
- {
- gtk_gesture_long_press_end (gesture, sequence);
- priv->cancelled = TRUE;
- }
+ gtk_gesture_long_press_end (gesture, sequence);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]