GNOME Bugzilla – Bug 764519
Two finger tap on title bars non-functional on GTK3 apps and wayland
Last modified: 2016-05-09 22:58:21 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.
touchpad or touchscreen ?
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.
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.
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.
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
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!
Attachment 325359 [details] pushed as a6cc35e - wayland: remove pressed button checks from meta_wayland_pointer_can_grab_surface()
I just checked with gtk 3.20.4 and this issue is still present. Was this patch pushed?
Yes, but it is not a gtk patch - the upcoming mutter 3.20.2 release will contain the commit.