From 99ce3deeb05162c0e97a884f47858e66930c8c0b Mon Sep 17 00:00:00 2001 From: verdre Date: Fri, 18 Jan 2019 09:37:04 +0100 Subject: [PATCH] st-button: Handle touch-cancel events Handling those events is neccessary if a touch event that pressed down a button turns out to be a gesture. In this case the button should be released without emitting the clicked signal. --- src/st/st-button.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/st/st-button.c b/src/st/st-button.c index a3a7b2442..a95ddff2d 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -262,6 +262,10 @@ st_button_touch_event (ClutterActor *actor, clutter_input_device_sequence_ungrab (device, sequence); return CLUTTER_EVENT_STOP; } + else if (event->type == CLUTTER_TOUCH_CANCEL) + { + st_button_fake_release (button); + } return CLUTTER_EVENT_PROPAGATE; }