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 734374 - wl_touch serials are ignored
wl_touch serials are ignored
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-08-06 17:52 UTC by Jonny Lamb
Modified: 2014-08-26 11:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdkdevice-wayland: set button_press_serial on wl_touch.down (1.00 KB, patch)
2014-08-06 17:54 UTC, Jonny Lamb
none Details | Review
wayland: rename internal touch management functions (3.05 KB, patch)
2014-08-22 12:05 UTC, Carlos Garnacho
committed Details | Review
wayland: Store per-touch touch_down serial (1016 bytes, patch)
2014-08-22 12:05 UTC, Carlos Garnacho
committed Details | Review
wayland: Improve implicit grab serial retrieval (6.55 KB, patch)
2014-08-22 12:05 UTC, Carlos Garnacho
committed Details | Review
wayland: Update the display serial on touch down/up events (1.49 KB, patch)
2014-08-22 12:05 UTC, Carlos Garnacho
committed Details | Review

Description Jonny Lamb 2014-08-06 17:52:26 UTC
The Gdk wayland backend never stores the serial (for example, as an argument to wl_touch.down), so it cannot be referred to later on, for example, in creating an xdg-popup.
Comment 1 Jonny Lamb 2014-08-06 17:54:02 UTC
Created attachment 282727 [details] [review]
gdkdevice-wayland: set button_press_serial on wl_touch.down

Here is a patch I wrote to work around the bug. It's not great as it abuses button_press_serial but it requires no other changes.
Comment 2 Matthias Clasen 2014-08-07 14:47:13 UTC
Carlos, any opinion ?
Comment 3 Carlos Garnacho 2014-08-22 12:03:59 UTC
I'm attaching a few patches to store per-touch serials. I think it makes sense to make this as it puts some somewhere forward, although from what I see xdg_popup and touch has its few inconsistences in compositors. On weston, when triggering a popup through touch, it always compares with the button serial on touch_up, and emits popup_done if it doesn't match (which doesn't), this causes the popup to just flicker on screen.

On native gnome-shell, the touch_up happens to be ignored (no serial matching happens either), but then touch only works meanwhile the pointer is on the popup window, something to be investigated separately.

Besides the obvious bugs, I see some lack of hints in the xdg_popup protocol docs about how should this behave generally with touch, and what happens with pre-popup existing touches. I'll be drafting some recommendations to compositors to fit in the docs there.
Comment 4 Carlos Garnacho 2014-08-22 12:05:33 UTC
Created attachment 284182 [details] [review]
wayland: rename internal touch management functions

These functions arent quite related to the device manager, so rename these
more conveniently.
Comment 5 Carlos Garnacho 2014-08-22 12:05:38 UTC
Created attachment 284183 [details] [review]
wayland: Store per-touch touch_down serial
Comment 6 Carlos Garnacho 2014-08-22 12:05:42 UTC
Created attachment 284184 [details] [review]
wayland: Improve implicit grab serial retrieval

_gdk_wayland_device_get_button_press_serial() has been replaced by
_gdk_wayland_device_get_implicit_grab_serial(), which takes a touch/pointer
event and figures out the relevant serial, and
_gdk_wayland_device_get_last_implicit_grab_serial() which returns
the most recent serial.

The button press serial was currently using when operating popping up
xdg_shell/surface popups and window menus, so this is now touch aware, of
some sort.
Comment 7 Carlos Garnacho 2014-08-22 12:05:47 UTC
Created attachment 284185 [details] [review]
wayland: Update the display serial on touch down/up events
Comment 8 Matthias Clasen 2014-08-26 00:14:12 UTC
Review of attachment 284182 [details] [review]:

ok
Comment 9 Matthias Clasen 2014-08-26 00:14:48 UTC
Review of attachment 284183 [details] [review]:

ok
Comment 10 Matthias Clasen 2014-08-26 00:15:00 UTC
Review of attachment 284183 [details] [review]:

ok
Comment 11 Matthias Clasen 2014-08-26 00:18:50 UTC
Review of attachment 284184 [details] [review]:

ok
Comment 12 Matthias Clasen 2014-08-26 00:31:20 UTC
Review of attachment 284185 [details] [review]:

ok
Comment 13 Carlos Garnacho 2014-08-26 11:35:49 UTC
Attachment 284182 [details] pushed as 12398c5 - wayland: rename internal touch management functions
Attachment 284183 [details] pushed as 5b86417 - wayland: Store per-touch touch_down serial
Attachment 284184 [details] pushed as 537ff9f - wayland: Improve implicit grab serial retrieval
Attachment 284185 [details] pushed as 6f789d5 - wayland: Update the display serial on touch down/up events