GNOME Bugzilla – Bug 756296
Only pointer serials are compared when popping up a window
Last modified: 2015-10-17 16:55:54 UTC
During wl/xdg_popup being shown mutter calls meta_wayland_pointer_can_popup(), which compares the given serial to the pointer's, and closes early the popup if it doesn't match. This obviously works fine for pointers, but if a client happens to show the popup with a serial coming from another device (touch, keyboard), the popup will be dismissed early this way. I'm attaching a couple of patches to abstract this a bit further adding a meta_wayland_seat_can_popup() that's used on these cases.
Created attachment 312962 [details] [review] wayland: Store key press/release serials on MetaWaylandKeyboard
Created attachment 312963 [details] [review] wayland: Make it possible to trigger popups through pointer/keyboard/touch Right now we just check the pointer serial, so the popup will be immediately dismissed if the client passes a serial corresponding to another input device. Abstract this a bit further and add a meta_wayland_seat_can_popup() call that will check the serial all input devices. This makes it possible to trigger menus through touch or keyboard devices.
Review of attachment 312962 [details] [review]: Looks good to me.
Review of attachment 312963 [details] [review]: This looks good to me too.
Attachment 312962 [details] pushed as dd5a4ec - wayland: Store key press/release serials on MetaWaylandKeyboard Attachment 312963 [details] pushed as a5d2555 - wayland: Make it possible to trigger popups through pointer/keyboard/touch