• Maksim Sisov's avatar
    ozone/wayland: Fix drop down menus for touch events. · 7138b785
    Maksim Sisov authored
    In case of touch events, we may not find currently focused windows
    as menu windows might be created on touch up events. Thus,
    GetCurrentFocusedWindow returns nullptr.
    
    To fix that, use a concept of a currently active window. That is,
    Wayland sets a window to "active" state if it has had a focus.
    There can be only one focused window at a time.
    
    Thus, if there is no a focused window, use currently active window
    as a parent. That's the best effort one could make to find a parent
    window for a newly created non-toplevel window. At some point,
    it might be worth reconsidering the design and make aura always pass
    parent widgets for new windows if applicable.
    
    Bug: 1123521
    Change-Id: Ib9479632e049df082ed17e3089680006a32f19fc
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385279
    Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
    Reviewed-by: default avatarNick Yamane <nickdiego@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#804674}
    7138b785
wayland_popup.cc 4.77 KB