[gtk+] gtkgesturesingle: Unset button/sequence if parent handle_event failed
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkgesturesingle: Unset button/sequence if parent handle_event failed
- Date: Fri, 17 Oct 2014 19:20:09 +0000 (UTC)
commit cfaec2d2f542fc55947241765ac1f27e0c7b25e1
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Oct 17 21:12:44 2014 +0200
gtkgesturesingle: Unset button/sequence if parent handle_event failed
There are legit reasons for GtkGesture::handle_event to return FALSE,
GtkGestureSingle objects should be unsetting the current button/sequence
if that happens, in order to avoid inconsistent states.
https://bugzilla.gnome.org/show_bug.cgi?id=738591
gtk/gtkgesturesingle.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkgesturesingle.c b/gtk/gtkgesturesingle.c
index 367d99c..c549e6d 100644
--- a/gtk/gtkgesturesingle.c
+++ b/gtk/gtkgesturesingle.c
@@ -220,6 +220,13 @@ gtk_gesture_single_handle_event (GtkEventController *controller,
if (sequence == priv->current_sequence &&
(event->type == GDK_BUTTON_RELEASE || event->type == GDK_TOUCH_END))
priv->current_button = 0;
+ else if (!retval)
+ {
+ if (button == priv->current_button && event->type == GDK_BUTTON_PRESS)
+ priv->current_button = 0;
+ else if (sequence == priv->current_sequence && event->type == GDK_TOUCH_BEGIN)
+ priv->current_sequence = NULL;
+ }
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]