Merge ~3v1n0/ubuntu/+source/gnome-shell:ubuntu/bionic-touch-two-clicks-fix into ~ubuntu-desktop/ubuntu/+source/gnome-shell:ubuntu/bionic

Proposed by Marco Trevisan (Treviño) on 2018-10-30
Status: Merged
Merged at revision: 716875deebdedf43d3870f957b58ecf49d36d419
Proposed branch: ~3v1n0/ubuntu/+source/gnome-shell:ubuntu/bionic-touch-two-clicks-fix
Merge into: ~ubuntu-desktop/ubuntu/+source/gnome-shell:ubuntu/bionic
Prerequisite: ~3v1n0/ubuntu/+source/gnome-shell:ubuntu/bionic-theming-fixes
Diff against target: 71 lines (+45/-0)
3 files modified
debian/changelog (+2/-0)
debian/patches/series (+1/-0)
debian/patches/st-button-Ignore-pointer-emulated-touch-events.patch (+42/-0)
Reviewer Review Type Date Requested Status
Didier Roche 2018-10-30 Approve on 2018-10-30
Review via email: mp+357993@code.launchpad.net
To post a comment you must log in.
Didier Roche (didrocks) wrote :

Please ensure the bugs is SRU-formatted. LGTM otherwise.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0ce4a7d..c6ad925 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -9,6 +9,8 @@ gnome-shell (3.28.3-0ubuntu0.18.04.3) UNRELEASED; urgency=medium
6 * debian/ubuntu.css:
7 - use defined color for menu separators (LP: #1739931)
8 - set StEntry minimun height to work properly with Ubuntu font (LP: #1743058)
9+ * debian/patches/st-button-Ignore-pointer-emulated-touch-events.patch:
10+ - Don't emit two click events on touch under X11 (LP: #1745888)
11
12 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Wed, 03 Oct 2018 00:50:42 +0200
13
14diff --git a/debian/patches/series b/debian/patches/series
15index ad2c4be..217740f 100644
16--- a/debian/patches/series
17+++ b/debian/patches/series
18@@ -25,4 +25,5 @@ popupMenu-Don-t-handle-key-presses-directly-if-there-are-.patch
19 viewSelector-Cancel-search-on-overview-hidden.patch
20 search-Cancel-search-provider-operations-on-clear.patch
21 search-Ignore-search-provider-results-metas-if-search-is-.patch
22+st-button-Ignore-pointer-emulated-touch-events.patch
23 ubuntu/search-call-XUbuntuCancel-method-on-providers-when-no-dat.patch
24diff --git a/debian/patches/st-button-Ignore-pointer-emulated-touch-events.patch b/debian/patches/st-button-Ignore-pointer-emulated-touch-events.patch
25new file mode 100644
26index 0000000..538bb17
27--- /dev/null
28+++ b/debian/patches/st-button-Ignore-pointer-emulated-touch-events.patch
29@@ -0,0 +1,42 @@
30+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
31+Date: Thu, 25 Oct 2018 06:35:25 +0200
32+Subject: st-button: Ignore pointer emulated touch events
33+
34+In X11, pointer emulated touch events are replicated with normal PRESS, RELEASE
35+pair events which are generated by the server. Thus for a single tap we get:
36+ - TOUCH_BEGIN -> TOUCH_END, PRESS -> RELEASE
37+
38+This will cause st-button to send two "clicked" signals, instead of just one,
39+breaking extensions (like dash-to-dock) that show buttons in the main stage
40+which will be checked two times or that will receive the same signal two times.
41+
42+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1745888
43+Forwarded: yes, https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/272
44+---
45+ src/st/st-button.c | 7 +++++--
46+ 1 file changed, 5 insertions(+), 2 deletions(-)
47+
48+diff --git a/src/st/st-button.c b/src/st/st-button.c
49+index 8f5c492..a3a7b24 100644
50+--- a/src/st/st-button.c
51++++ b/src/st/st-button.c
52+@@ -248,14 +248,17 @@ st_button_touch_event (ClutterActor *actor,
53+ if (event->type == CLUTTER_TOUCH_BEGIN && !priv->press_sequence)
54+ {
55+ clutter_input_device_sequence_grab (device, sequence, actor);
56+- st_button_press (button, device, 0, sequence);
57++ if (!clutter_event_is_pointer_emulated ((ClutterEvent*) event))
58++ st_button_press (button, device, 0, sequence);
59+ return CLUTTER_EVENT_STOP;
60+ }
61+ else if (event->type == CLUTTER_TOUCH_END &&
62+ priv->device == device &&
63+ priv->press_sequence == sequence)
64+ {
65+- st_button_release (button, device, mask, 0, sequence);
66++ if (!clutter_event_is_pointer_emulated ((ClutterEvent*) event))
67++ st_button_release (button, device, mask, 0, sequence);
68++
69+ clutter_input_device_sequence_ungrab (device, sequence);
70+ return CLUTTER_EVENT_STOP;
71+ }

Subscribers

People subscribed via source and target branches