• Giovanni Ortuño Urquidi's avatar
    Revert "ozone/wayland: Fix drop down menus for touch events." · 6a379892
    Giovanni Ortuño Urquidi authored
    This reverts commit 7138b785.
    
    Reason for revert: Suspected of breaking 
    SitePerProcessBrowserTest.TwoSubframesCreatePopupMenuWidgetsSimultaneously
    
    First failing build: https://ci.chromium.org/p/chromium/builders/ci/linux-lacros-tester-rel/b8869837198909294608
    
    BrowserTestBase received signal: Segmentation fault. Backtrace:
    #0 0x559ad6eab7c9 base::debug::CollectStackTrace()
    #1 0x559ad6e2def3 base::debug::StackTrace::StackTrace()
    #2 0x559ad6ab8a96 content::(anonymous namespace)::DumpStackTraceSignalHandler()
    #3 0x7fe4e02044c0 (/lib/x86_64-linux-gnu/libc-2.23.so+0x354bf)
    #4 0x559ad9fe3f7b views::DesktopWindowTreeHostPlatform::Show()
    #5 0x559ad9fb9a14 views::Widget::Show()
    #6 0x559ad9fdf230 views::(anonymous namespace)::DesktopNativeWidgetAuraWindowParentingClient::GetDefaultParent()
    #7 0x559ad6e0ee49 aura::client::ParentWindowWithContext()
    #8 0x559ad66b0c08 content::RenderWidgetHostViewAura::InitAsPopup()
    #9 0x559ad67c22ae content::WebContentsImpl::ShowCreatedWidget()
    
    Original change's description:
    > ozone/wayland: Fix drop down menus for touch events.
    > 
    > 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: Nick Yamane <nickdiego@igalia.com>
    > Cr-Commit-Position: refs/heads/master@{#804674}
    
    TBR=tonikitoo@igalia.com,msisov@igalia.com,nickdiego@igalia.com
    
    Change-Id: I07fc59524cca2e61553c43eec4d566cc99a62286
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 1123521
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2397301Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
    Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#804843}
    6a379892
wayland_popup.cc 5.01 KB