GNOME Bugzilla – Bug 734374
wl_touch serials are ignored
Last modified: 2014-08-26 11:36:07 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.
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.
Carlos, any opinion ?
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.
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.
Created attachment 284183 [details] [review] wayland: Store per-touch touch_down serial
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.
Created attachment 284185 [details] [review] wayland: Update the display serial on touch down/up events
Review of attachment 284182 [details] [review]: ok
Review of attachment 284183 [details] [review]: ok
Review of attachment 284184 [details] [review]: ok
Review of attachment 284185 [details] [review]: ok
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