GNOME Bugzilla – Bug 697192
can't use top bar menus on touch
Last modified: 2014-09-01 09:49:25 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.
Also tap on notification banners doesn't do anything except show the close "x".
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.
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.
*** Bug 698843 has been marked as a duplicate of this bug. ***
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.
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.
So what's the solution?
(In reply to comment #7) > So what's the solution? I think the solution would be responding to TouchBegin as well as mouse events.
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.
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?
(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 :)
You can also use a ClutterTapAction instead of an 'event' signal handler.
(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.
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.
Hi, Is there anything further I need to do in order for these to be submitted? Regards Anthony
We're going to take a different approach...
Ok, any idea when this will happen?
I'll try to submit a patch today. I just need to get my Chromebook Pixel running again...
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.
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.
(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?
(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,
Server bug has been identified and filed at https://bugs.freedesktop.org/show_bug.cgi?id=66720
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.
Review of attachment 248881 [details] [review]: Fine for the stable branch.
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.
I have the same bug, but I don't know how to apply this patch, can you tell me how?
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.
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.
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.