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 771305 - wayland: Make it (maybe) possible to create popup grabs with only touch again
wayland: Make it (maybe) possible to create popup grabs with only touch again
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-09-12 15:26 UTC by Jonas Ådahl
Modified: 2016-09-15 02:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland/seat: Add API to check whether a seat has a device class (2.04 KB, patch)
2016-09-12 15:26 UTC, Jonas Ådahl
committed Details | Review
wayland: Add common object for device classes (9.37 KB, patch)
2016-09-12 15:26 UTC, Jonas Ådahl
none Details | Review
wayland: Move device seat association to MetaWaylandInputDevice (18.12 KB, patch)
2016-09-12 15:27 UTC, Jonas Ådahl
committed Details | Review
MetaWaylandPointer: Initialize default grab on init (2.12 KB, patch)
2016-09-12 15:27 UTC, Jonas Ådahl
committed Details | Review
wayland: Add common object for device classes (9.37 KB, patch)
2016-09-13 07:32 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2016-09-12 15:26:43 UTC
It seems for some reason we could create popup grabs with touch devices even
when there were no pointer devices on the device. Possibly it could also have
been because pointer devices are classified differently now, thus not enabling
the pointer device class when it was before. Either way, a system without a
pointer could popup popups before, but can't now, and this is an attempt to fix
that.
Comment 1 Jonas Ådahl 2016-09-12 15:26:48 UTC
Created attachment 335368 [details] [review]
wayland/seat: Add API to check whether a seat has a device class

Meant to replace explicitly checking whether a
MetaWaylandPointer/MetaWaylandKeyboard/MetaWaylandTouch has a seat or
not to determine whether they are supposed to be active or not.
Comment 2 Jonas Ådahl 2016-09-12 15:26:55 UTC
Created attachment 335369 [details] [review]
wayland: Add common object for device classes

Add a new object class, MetaWaylandInputDevice, and make all device
classes (pointer, keyboard, touch) inherit it. In the future common
functionality may be placed there.
Comment 3 Jonas Ådahl 2016-09-12 15:27:00 UTC
Created attachment 335370 [details] [review]
wayland: Move device seat association to MetaWaylandInputDevice

Make the device <-> seat association permanent, and move it into
MetaWaylandInputDevice. A device will never be disassociated with a
seat, so there is no point in unsetting it.
Comment 4 Jonas Ådahl 2016-09-12 15:27:05 UTC
Created attachment 335371 [details] [review]
MetaWaylandPointer: Initialize default grab on init

Instead of initializing the default grab when the device class is
enabled, initialize it on object initialization. This way other device
classes can still grab the pointer, as if there was one. This may be
useful for example if a touch grab is active and a mouse is connected.

This also makes it possible for popup grabs, which currently use a
pointer grab for controlling, to be triggered by touch devices, while
still holding an active pointer grab.
Comment 5 Jonas Ådahl 2016-09-13 07:32:09 UTC
Created attachment 335417 [details] [review]
wayland: Add common object for device classes

Add a new object class, MetaWaylandInputDevice, and make all device
classes (pointer, keyboard, touch) inherit it. In the future common
functionality may be placed there.
Comment 6 Carlos Garnacho 2016-09-13 15:52:30 UTC
Comment on attachment 335368 [details] [review]
wayland/seat: Add API to check whether a seat has a device class

Much better than foo->seat != NULL :)
Comment 7 Carlos Garnacho 2016-09-13 15:53:27 UTC
Comment on attachment 335417 [details] [review]
wayland: Add common object for device classes

Makes sense, perhaps the enable/disable functions are good first candidates for MetaWaylandInputDevice vmethods.
Comment 8 Carlos Garnacho 2016-09-13 15:55:10 UTC
Comment on attachment 335370 [details] [review]
wayland: Move device seat association to MetaWaylandInputDevice

Looks good. Nice simplification of the relationship semantics.
Comment 9 Carlos Garnacho 2016-09-13 15:55:51 UTC
Comment on attachment 335371 [details] [review]
MetaWaylandPointer: Initialize default grab on init

Makes sense for the time being. I should work again on compositor grabs...
Comment 10 Carlos Garnacho 2016-09-13 15:56:18 UTC
FWIW, I tried the patches and fix the crash here.
Comment 11 Carlos Garnacho 2016-09-13 16:01:38 UTC
Comment on attachment 335370 [details] [review]
wayland: Move device seat association to MetaWaylandInputDevice

Btw, in this one probably we should add

#include "meta-wayland-input-device.h"

in all of meta-wayland-pointer/keyboard/touch.h, I had local compile errors because G_DECLARE_FINAL_TYPE there doesn't find MetaWaylandInputDeviceClass. Adding MetaWaylandInputDeviceClass to meta-wayland-types.h should also work I guess.
Comment 12 Jonas Ådahl 2016-09-14 01:08:17 UTC
It's included in meta-wayland-seat.h (as are the other (keyboard/touch/..). It was fixed in the patch uploaded last (replaced the broken one).
Comment 13 Jonas Ådahl 2016-09-15 02:32:37 UTC
Attachment 335368 [details] pushed as d2cdbd4 - wayland/seat: Add API to check whether a seat has a device class
Attachment 335370 [details] pushed as 87f82d9 - wayland: Move device seat association to MetaWaylandInputDevice
Attachment 335371 [details] pushed as 98f0578 - MetaWaylandPointer: Initialize default grab on init
Attachment 335417 [details] pushed as a6646b3 - wayland: Add common object for device classes