diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2018-10-25 06:35:25 +0200 |
---|---|---|
committer | Marco Trevisan <mail@3v1n0.net> | 2018-11-26 21:18:25 +0000 |
commit | 4c11d15a074aeca72627c44e327e2dc2afa93ae3 (patch) | |
tree | 52902eaa2d620f9a67a9521cb79724727a253548 | |
parent | 3217c10ff272f44d50afc881ce2a2dbb911dc1e8 (diff) | |
download | gnome-shell-4c11d15a074aeca72627c44e327e2dc2afa93ae3.tar.gz |
st-button: Ignore pointer emulated touch events
In X11, pointer emulated touch events are replicated with normal PRESS, RELEASE
pair events which are generated by the server. Thus for a single tap we get:
- TOUCH_BEGIN -> TOUCH_END, PRESS -> RELEASE
This will cause st-button to send two "clicked" signals, instead of just one,
breaking extensions (like dash-to-dock) that show buttons in the main stage
which will be checked two times or that will receive the same signal two times.
-rw-r--r-- | src/st/st-button.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/st/st-button.c b/src/st/st-button.c index 8f5c4922f..a3a7b2442 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -248,14 +248,17 @@ st_button_touch_event (ClutterActor *actor, if (event->type == CLUTTER_TOUCH_BEGIN && !priv->press_sequence) { clutter_input_device_sequence_grab (device, sequence, actor); - st_button_press (button, device, 0, sequence); + if (!clutter_event_is_pointer_emulated ((ClutterEvent*) event)) + st_button_press (button, device, 0, sequence); return CLUTTER_EVENT_STOP; } else if (event->type == CLUTTER_TOUCH_END && priv->device == device && priv->press_sequence == sequence) { - st_button_release (button, device, mask, 0, sequence); + if (!clutter_event_is_pointer_emulated ((ClutterEvent*) event)) + st_button_release (button, device, mask, 0, sequence); + clutter_input_device_sequence_ungrab (device, sequence); return CLUTTER_EVENT_STOP; } |