• Maksim Sisov's avatar
    ozone/wayland: fix grabbing of menus with touch events. · 4ee02a10
    Maksim Sisov authored
    According to the xdg_popup protocol, popups can be grabbed
    upon touch down, pointer press or keyboard down events. It's
    also fine to store a serial of a pointer press event, wait
    until pointer released event comes and grab a popup
    using the serial before the last event (basically, the one
    that came with pointer press).
    
    However, the same technique doesn't work with touch events and
    some compositors such as Mutter just dismiss the popup. Some
    versions of Weston also do the same.
    
    Previously, we just disabled grabs for gnome environment, but
    it's not that correct. There is a better way to handle that.
    
    Instead, store serials from both touch down and up events and
    make it possible to check what was the last event. If it was
    touch down, do not grab the popup. If the last event was
    up, avoid grabbing the popup as long as we can't use the
    serial from the event before touch up event came.
    
    Bug: 1123521
    Change-Id: If9869271328372a80f55d81a469960f3965f7b6c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385280
    Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
    Reviewed-by: default avatarNick Yamane <nickdiego@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#804691}
    4ee02a10
wayland_pointer.cc 4.78 KB