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 764519 - Two finger tap on title bars non-functional on GTK3 apps and wayland
Two finger tap on title bars non-functional on GTK3 apps and wayland
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-04-03 05:07 UTC by Britt Yazel
Modified: 2016-05-09 22:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: remove pressed button checks from meta_wayland_pointer_can_grab_surface() (6.41 KB, patch)
2016-04-04 16:23 UTC, Carlos Garnacho
committed Details | Review

Description Britt Yazel 2016-04-03 05:07:16 UTC
Using Gnome 3.20 and Wayland on Archlinux, when I two finger tap the title bar of any gtk3 app nothing happens, whereas the right-click context menu should pop up. However, right clicking does still result in the context menu, so appears to just be tied to the two finger touch gesture. Further, it is specifically on the title bars, double click tapping within a window still opens the appropriate context menu.

Oddly enough, non gtk3 apps (chrome, vlc) or gtk2 apps have their two finger tap gestures working just fine on the title bars. I guess this is probably do to them using xwayland.
Comment 1 Matthias Clasen 2016-04-04 15:15:27 UTC
touchpad or touchscreen ?
Comment 2 Carlos Garnacho 2016-04-04 15:37:59 UTC
I can reproduce with touchpad. AFAICS this was originally introduced by the patch in https://bugzilla.gnome.org/show_bug.cgi?id=731237#c11 .

What happens here is that libinput will transform the 2 finger tap in two consecutive press+release events. Those are handled almost at once in clutter/mutter, so when the client has the opportunity to request xdg_surface.show_window_menu, the button count will again/already be 0, so the request is ignored.

The check for buttons being pressed makes sense for drags/resizes, not as much for this "show menu" case, probably should be taken out of meta_wayland_pointer_can_grab_surface() checks and into the interested callers.

Moving to mutter.
Comment 3 Carlos Garnacho 2016-04-04 16:23:20 UTC
Created attachment 325359 [details] [review]
wayland: remove pressed button checks from meta_wayland_pointer_can_grab_surface()

Leave these checks up to the callers, the only uses of this function
(indirect, through meta_wayland_seat_get_grab_info) are
[wl_shell|xdg]_surface.move/resize/show_window_menu.

In move/resize it makes sense to check for a button being pressed, because
we must expect a button release event. However for xdg_surface.show_window_menu
we 1) don't strictly need further events and 2) we must account for press+release
event pairs being processed at once in the compositor before the client sees
the former.

That is eg. the case of touchpad 2nd/3rd button tap emulation, multifinger
taps will emit the event pair at once, so when the client manages to request
xdg_surface.show_window_menu, it'll be too late in the compositor side, so the
request is ignored.
Comment 4 Britt Yazel 2016-04-04 18:39:26 UTC
Thank you for looking at this so quickly!

As per Mathias's question (which is kind of superfluous at this point), yes this is with a touchpad not a touch screen.
Comment 5 Rui Matos 2016-04-13 17:30:35 UTC
Review of attachment 325359 [details] [review]:

otherwise looks good

::: src/wayland/meta-wayland-surface.c
@@ +1363,3 @@
   MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
 
+  if (!meta_wayland_seat_get_grab_info (seat, surface, serial, NULL, NULL, FALSE))

the boolean argument should be the 4th and likewise on the other calls below
Comment 6 Carlos Garnacho 2016-04-25 12:25:31 UTC
Oops, lost track of this bug...

(In reply to Rui Matos from comment #5)
> Review of attachment 325359 [details] [review] [review]:
> 
> otherwise looks good
> 
> ::: src/wayland/meta-wayland-surface.c
> @@ +1363,3 @@
>    MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
>  
> +  if (!meta_wayland_seat_get_grab_info (seat, surface, serial, NULL, NULL,
> FALSE))
> 
> the boolean argument should be the 4th and likewise on the other calls below

Indeed, that's what I get for a last minute quick refactor. Pushing a fixed patch.

Thanks for the review!
Comment 7 Carlos Garnacho 2016-04-25 12:27:39 UTC
Attachment 325359 [details] pushed as a6cc35e - wayland: remove pressed button checks from meta_wayland_pointer_can_grab_surface()
Comment 8 Britt Yazel 2016-05-09 22:29:15 UTC
I just checked with gtk 3.20.4 and this issue is still present. Was this patch pushed?
Comment 9 Florian Müllner 2016-05-09 22:58:21 UTC
Yes, but it is not a gtk patch - the upcoming mutter 3.20.2 release will contain the commit.