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 777333 - In a GNOME Wayland session, gnome-terminal windows cannot be moved around with a wacom pen
In a GNOME Wayland session, gnome-terminal windows cannot be moved around wit...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 783720 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-01-16 15:16 UTC by el
Modified: 2017-07-21 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mutter: wayland: Store and retrieve implicit grab information for tablet tools (7.54 KB, patch)
2017-06-23 23:04 UTC, Jason Gerecke
none Details | Review
GTK: wayland: Get implicit grab serial information from tablet devices (2.43 KB, patch)
2017-06-23 23:05 UTC, Jason Gerecke
committed Details | Review
Mutter: wayland: Store and retrieve implicit grab information for tablet tools (7.29 KB, patch)
2017-07-07 23:02 UTC, Jason Gerecke
committed Details | Review

Description el 2017-01-16 15:16:25 UTC
In a GNOME Wayland session, gnome-terminal windows cannot be moved around with a wacom pen: when I use my wacom pen in a GNOME Wayland session and press it down on a window title bar and drag, I can perfectly move all windows around - except strangely any of the gnome-terminal windows.

Since this is basic window management functionality, I would suggest this should be fixed if people are expected to switch to Wayland even if they have a laptop with a Wacom pen.
Comment 1 el 2017-01-16 15:19:18 UTC
Ok I just noticed that this also affects Nautilus, even though strangely enoough I can interact with everything else of the Nautilus interface just fine and I can also move around Firefox windows perfectly fine (although I cannot interact with firefox UI widgets, probably due to https://bugs.freedesktop.org/show_bug.cgi?id=99411 ).

So I guess this might actually be some more widespread issue than I assumed from my initial test.
Comment 2 Christian Persch 2017-01-16 15:23:56 UTC
-> gtk+:wayland
Comment 3 Debarshi Ray 2017-01-16 15:25:31 UTC
Firefox is still using X - either Xorg or Xwayland.
Comment 4 Carlos Garnacho 2017-01-16 15:44:06 UTC
This is a mutter issue.
Comment 5 Jason Gerecke 2017-06-15 21:28:04 UTC
I did some tracing with GDB to better understand where the issue lies. It looks like when the GTK side of things works fine: when you start to drag a window, things eventually get all the way down to a call to `zxdg_toplevel_v6_move` where it becomes Mutter's responsibility.

Within Mutter, the `xdg_toplevel_move` function is where processing starts. That function calls `meta_wayland_seat_get_grab_info` to get some X/Y coordinates, but the function is currently only capable of working with events from a "pointer" or "touch" device attached to the Wayland seat. It does not know how to deal with tablet tools, so processing stops and the window is never moved.

It isn't immediately obvious to me how support would be added... Definitely something for the Mutter developers to work on.
Comment 6 Jason Gerecke 2017-06-23 23:02:47 UTC
I did a bit more research into this and was able to come up with a pair of patches that resolve this and bug 783720. I'd appreciate a critical review since I'm not very familiar with how implicit grabs are expected to work within Mutter and there may be something I've missed.
Comment 7 Jason Gerecke 2017-06-23 23:04:49 UTC
Created attachment 354345 [details] [review]
Mutter: wayland: Store and retrieve implicit grab information for tablet tools
Comment 8 Jason Gerecke 2017-06-23 23:05:53 UTC
Created attachment 354346 [details] [review]
GTK: wayland: Get implicit grab serial information from tablet devices
Comment 9 Carlos Garnacho 2017-07-05 22:35:50 UTC
Review of attachment 354345 [details] [review]:

Makes sense, and turns out it's sufficient for window dragging. We still do need something like MetaWaylandPointerGrabInterface to cater for dnd and xdg_popup, but probably can be handled separately.

The patch itself looks good! Just a minor comment.

::: src/wayland/meta-wayland-tablet-tool.c
@@ +886,3 @@
+      tool->grab_button = event->button.button;
+      tool->grab_time = clutter_event_get_time (event);
+      tool->grab_serial = wl_display_get_serial (tool->seat->seat->wl_display);

grab_serial seems unused. You compare with both down_serial and button_serial on can_grab_surface() which seems right.

Same for grab_button and grab_time, really...
Comment 10 Jason Gerecke 2017-07-07 23:02:11 UTC
Created attachment 355131 [details] [review]
Mutter: wayland: Store and retrieve implicit grab information for tablet tools

Removed unused grab_button grab_time and grab_serial variables as suggested
Comment 11 Carlos Garnacho 2017-07-13 17:06:26 UTC
Comment on attachment 355131 [details] [review]
Mutter: wayland: Store and retrieve implicit grab information for tablet tools

Looks good.
Comment 12 Carlos Garnacho 2017-07-13 17:08:46 UTC
Comment on attachment 354346 [details] [review]
GTK: wayland: Get implicit grab serial information from tablet devices

Besides minor indenting nits, looks good. I'll fix those up while pushing.
Comment 13 Carlos Garnacho 2017-07-13 17:17:53 UTC
Comment on attachment 355131 [details] [review]
Mutter: wayland: Store and retrieve implicit grab information for tablet tools

Attachment 355131 [details] pushed as ca60097 - wayland: Store and retrieve implicit grab information for tablet tools
Comment 14 Carlos Garnacho 2017-07-20 12:25:49 UTC
Attachment 354346 [details] pushed as 3a83de295
Comment 15 Carlos Garnacho 2017-07-21 09:30:42 UTC
*** Bug 783720 has been marked as a duplicate of this bug. ***