[gnome-shell/gnome-3-28] dnd: Only handle touch events in wayland
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-28] dnd: Only handle touch events in wayland
- Date: Tue, 19 Mar 2019 01:33:41 +0000 (UTC)
commit 4c7b20e584728e7b53bb01020b9bd44cab1f337b
Author: Andrea Azzarone <andrea azzarone canonical com>
Date: Mon Mar 4 16:14:22 2019 +0000
dnd: Only handle touch events in wayland
There are serveral issues around touch passive grab and touch/pointer doubly
handling to use these on X11, so we stick to single-touch/pointer there.
Cherry picked from commit 60ccdc2deb746c0d96b0268ee5034b65478ce779
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1015
js/ui/dnd.js | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index ec1ba1d41..a36b1f6a4 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -125,6 +125,16 @@ var _Draggable = new Lang.Class({
},
_onTouchEvent(actor, event) {
+ // Here we only handle touch events on wayland. On X11
+ // we do get emulated pointer events, which already works
+ // for single-touch cases. Besides, the X11 passive touch grab
+ // set up by Mutter will make us see first the touch events
+ // and later the pointer events, so it will look like two
+ // unrelated series of events, we want to avoid double handling
+ // in these cases.
+ if (!Meta.is_wayland_compositor())
+ return Clutter.EVENT_PROPAGATE;
+
if (event.type() != Clutter.EventType.TOUCH_BEGIN ||
!global.display.is_pointer_emulating_sequence(event.get_event_sequence()))
return Clutter.EVENT_PROPAGATE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]