After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697192 - can't use top bar menus on touch
can't use top bar menus on touch
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
touch
: 698843 (view as bug list)
Depends on: 703969
Blocks:
 
 
Reported: 2013-04-03 16:35 UTC by William Jon McCann
Modified: 2014-09-01 09:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix which tells Gnome Shell to act on TouchBegin and TouchEnd as well as ButtonPress and ButtonRelease in order to provide support for touchscreens. (6.69 KB, patch)
2013-05-28 21:02 UTC, Anthony
none Details | Review
main: Don't select for touch events on the stage (1.18 KB, patch)
2013-07-10 21:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description William Jon McCann 2013-04-03 16:35:11 UTC
I am unable to display the contents of the menus in the top bar when using a touch screen. This is odd because the menus in the login and lock screen work fine.
Comment 1 William Jon McCann 2013-04-05 19:16:06 UTC
Also tap on notification banners doesn't do anything except show the close "x".
Comment 2 Stefan Seidel 2013-04-23 07:45:03 UTC
I'm noticing this, too. This was very rarely the case with the 3.8.0.1 Arch Linux Build, but started being always like that with 3.8.1. I checked with xev and could not find any big difference between a single finger tap and a left mouse click.

I also use the Dash to Dock extension and I'm not able to start Launchers via touch, touch, then click works fine, but is annoying.

I'm using a Sony Vaio Duo 11 with n-Trig DuoSense touchscreen, ENAC kernel module for it and the regular Arch Linux xf86-input-evdev driver.

Do request more information if needed.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-04-23 14:13:10 UTC
The difference is that since Clutter selects for touch events on the stage, we don't get emulated pointer events, only TouchBegin events which we don't respond to.

When we open the overview or a menu or something, we take a grab that only includes ButtonPress/ButtonRelease, so those are guaranteed to work.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-04-25 14:52:14 UTC
*** Bug 698843 has been marked as a duplicate of this bug. ***
Comment 5 Stefan Seidel 2013-04-25 18:35:07 UTC
Jasper, but why did it work fine before? And why is basically every other application fine with it, even in the Activities view I can touch the dock icons just fine and it works as expected? Actually, also the menus in the top bar work fine when I'm in the Activities view.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-04-25 18:36:49 UTC
It probably worked fine before because older versions of Clutter didn't select for touch events, so we got emulated pointer events.

Inside the activities view, we take a modal grab without touch events selected, so we do get emulated pointer events.
Comment 7 Stefan Seidel 2013-04-25 18:37:52 UTC
So what's the solution?
Comment 8 Elad Alfassa 2013-04-26 10:58:20 UTC
(In reply to comment #7)
> So what's the solution?

I think the solution would be responding to TouchBegin as well as mouse events.
Comment 9 Anthony 2013-05-28 17:29:10 UTC
Could you explain that a bit further please?

I thought I'd have a look (worth saying I've never used clutter before).

The earlier comment said you were only using ButtonPress/ButtonRelease and that you needed to start using TouchBegin (and I assume TouchEnd) as well.

So starting with the on screenkeyboard I found the following in keyboard.js:
let press = type == Clutter.EventType.BUTTON_PRESS;
key.connect('button-press-event', Lang.bind(this, function () {this._key.press(); }));
button.connect('button-press-event', Lang.bind(this, function () {extended_key.press(); }));

And the corresponding ButtonRelease events.

Regarding the connect functions. I can't find the corresponding touch names?
I looked up the clutter actor: https://developer.gnome.org/clutter/1.8/ClutterActor.html

Which has putton-press-event but there is no mention of a touch begin event.


When I tried touch-begin-event (worth as shot) it wouldn't start.

The next thing I tried was the line:
let press = type == Clutter.EventType.BUTTON_PRESS;

Which I tried changing to:
let press = (type == Clutter.EventType.BUTTON_PRESS || type == Clutter.EventType.TOUCH_BEGIN);

With this change, the keyboard would still start, but it still wouldn't work with finger touches.


Any suggestions regarding what to try next? I'm currently only looking at the keyboard since I figured if I could work that out, I could do the same thing everywhere else.
Comment 10 Anthony 2013-05-28 18:46:05 UTC
Worked it out (I think) When a connection is made to the signal button-press-event or button-press-release. You have to instead catch all "event" signals and filter for TOUCH_BEGIN || BUTTON_PRESS (or TOUCH_END || BUTTON_RELEASE)

I have most of the functionality back by adjusting panel.js, panelMenu.js and keyboard.js
Is there a way I can submit these fixes?
Comment 11 Elad Alfassa 2013-05-28 18:49:52 UTC
(In reply to comment #10)
> Is there a way I can submit these fixes?
Are you familiar with git?

These links should help

https://live.gnome.org/Git/WorkingWithPatches
https://live.gnome.org/Git

Can't wait to test your fixes :)
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-05-28 19:03:54 UTC
You can also use a ClutterTapAction instead of an 'event' signal handler.
Comment 13 Emmanuele Bassi (:ebassi) 2013-05-28 19:14:13 UTC
(In reply to comment #9)
> Regarding the connect functions. I can't find the corresponding touch names?
> I looked up the clutter actor:
> https://developer.gnome.org/clutter/1.8/ClutterActor.html
> 
> Which has putton-press-event but there is no mention of a touch begin event.

touch events have been added in Clutter 1.10, and were not available in 1.8; you should always use this link:

  https://developer.gnome.org/clutter/stable/ClutterActor.html

to get the API reference for the currently stable version of Clutter's API. in order to catch touch events, you should connect to the "touch-event" signal:

  https://developer.gnome.org/clutter/stable/ClutterActor.html#ClutterActor-touch-event

and check the event type.

you can also use a ClutterTapAction:

  https://developer.gnome.org/clutter/stable/ClutterTapAction.html

which is a gesture recognizer for single tap, both with pointer and with touch events.
Comment 14 Anthony 2013-05-28 21:02:57 UTC
Created attachment 245495 [details] [review]
Fix which tells Gnome Shell to act on TouchBegin and TouchEnd as well as ButtonPress and ButtonRelease in order to provide support for touchscreens.
Comment 15 Anthony 2013-06-28 18:33:33 UTC
Hi,

Is there anything further I need to do in order for these to be submitted?

Regards

Anthony
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-06-28 18:36:22 UTC
We're going to take a different approach...
Comment 17 Anthony 2013-06-28 18:38:08 UTC
Ok, any idea when this will happen?
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-06-28 18:45:49 UTC
I'll try to submit a patch today. I just need to get my Chromebook Pixel running again...
Comment 19 TS 2013-07-04 23:21:31 UTC
Any news on the official fix?

I've tried Anthony's patch and it improves the situation a lot for me. The only thing that doesn't work reliably is moving windows by tapping and dragging the titlebar.
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-07-04 23:30:51 UTC
Our stopgap fix which we planned to push out for 3.8 and 3.10 uncovered a bug in the X server. I've notified our X team to figure out where the bug originates from.
Comment 21 Bastien Nocera 2013-07-05 07:12:56 UTC
(In reply to comment #20)
> Our stopgap fix which we planned to push out for 3.8 and 3.10 uncovered a bug
> in the X server. I've notified our X team to figure out where the bug
> originates from.

Where's the stopgap fix?
Comment 22 Jasper St. Pierre (not reading bugmail) 2013-07-05 14:41:36 UTC
(In reply to comment #21)
> Where's the stopgap fix?

I have patches to Clutter and Mutter, and I've given them to the X server developers to figure out what the bug is. I can attach them here if you want to see the super exciting X server bug with your own eyes,
Comment 23 Jasper St. Pierre (not reading bugmail) 2013-07-09 01:21:06 UTC
Server bug has been identified and filed at https://bugs.freedesktop.org/show_bug.cgi?id=66720
Comment 24 Jasper St. Pierre (not reading bugmail) 2013-07-10 21:26:57 UTC
Created attachment 248881 [details] [review]
main: Don't select for touch events on the stage

GNOME Shell's actors aren't touch capable, so we need to make sure that
they get the fallback pointer emulated events for now. This fixes the top
bar and other elements not working on a touchscreen without a grab.
Comment 25 Giovanni Campagna 2013-07-15 15:52:17 UTC
Review of attachment 248881 [details] [review]:

Fine for the stable branch.
Comment 26 Jasper St. Pierre (not reading bugmail) 2013-07-15 16:48:40 UTC
Attachment 248881 [details] pushed as 3b51405 - main: Don't select for touch events on the stage


Fixed in master. This will require a new Clutter and X server patches -- see the corresponding X server bug.
Comment 27 Mauricio Andrés 2013-08-09 19:31:22 UTC
I have the same bug, but I don't know how to apply this patch, can you tell me how?
Comment 28 mar.matejka 2014-08-31 08:12:32 UTC
Hi,

I am currently experiencing the same behaviour on Ubuntu GNOME 14.04 with Gnome 3.10 and Touchegg 1.1.1 (all from distribution's repositories, I've already tried Gnome 3.12 from Gnome's staging ppa though with the same issue). The difference is that without Touchegg everything is running just fine. However, it doesn't seem to be a problem with Touchegg as such because the same was happening when I was using Ginn instead of Touchegg.

I'm not sure what exactly is causing the problem nor if it is a new bug or it is somehow related to this one. Apparently I'm not alone with this one (see this comment on similar bug of Touchegg, where I've already commented as well: https://code.google.com/p/touchegg/issues/detail?id=98#c21). In case I should file it somewhere else, please, let me know.
Comment 29 Jasper St. Pierre (not reading bugmail) 2014-08-31 16:21:39 UTC
mutter now takes a touch grab on the root window and handles gestures itself. I imagine that Touchegg is now failing because of that. Only one client can take a touch grab on the root window.
Comment 30 mar.matejka 2014-09-01 09:49:25 UTC
OK, is there any other way how to achieve the expected behaviour (i.e. working multitouch gestures in Gnome)? Currently even though mutter handles gestures itself, I'm not aware of the possibility of configuration of those gestures - and I haven't noticed any that would work out of the box except one finger scrolling in certain applications). That is why I wanted to use Touchegg / Ginn. As far as I understand there is probably no simple way (if any) that would fix Touchegg (and it would be pretty much just Gnome-specific fix), right? Will Gnome / mutter provide this functionality itself in close future? Because right now AFAIK it is not possible to use Gnome with multitouch (although otherwise it would be IMHO the most touch-friendly desktop environment for Linux).

I'm of course available for testing of patches / fixes / suggestions in case there will be any.