GNOME Bugzilla – Bug 777333
In a GNOME Wayland session, gnome-terminal windows cannot be moved around with a wacom pen
Last modified: 2017-07-21 09:30:42 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.
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.
-> gtk+:wayland
Firefox is still using X - either Xorg or Xwayland.
This is a mutter issue.
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.
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.
Created attachment 354345 [details] [review] Mutter: wayland: Store and retrieve implicit grab information for tablet tools
Created attachment 354346 [details] [review] GTK: wayland: Get implicit grab serial information from tablet devices
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...
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 on attachment 355131 [details] [review] Mutter: wayland: Store and retrieve implicit grab information for tablet tools Looks good.
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 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
Attachment 354346 [details] pushed as 3a83de295
*** Bug 783720 has been marked as a duplicate of this bug. ***