Open magreenblatt opened 2 years ago
The menu is a special Widget type created via this call stack (Windows M102):
> views.dll!views::Widget::Init(views::Widget::InitParams params) Line 322 C++
views.dll!views::MenuHost::InitMenuHost(const views::MenuHost::InitParams & init_params) Line 167 C++
views.dll!views::SubmenuView::ShowAt(const views::MenuHost::InitParams & init_params) Line 407 C++
views.dll!views::MenuController::OpenMenuImpl(views::MenuItemView * item, bool show) Line 2199 C++
views.dll!views::MenuController::OpenMenu(views::MenuItemView * item) Line 2127 C++
views.dll!views::MenuController::CommitPendingSelection() Line 2088 C++
views.dll!views::MenuController::SetSelection(views::MenuItemView * menu_item, int selection_types) Line 1407 C++
views.dll!views::MenuController::Run(views::Widget * parent, views::MenuButtonController * button_controller, views::MenuItemView * root, const gfx::Rect & bounds, views::MenuAnchorPosition position, bool context_menu, bool is_nested_drag, aura::Window * native_view_for_gestures) Line 540 C++
views.dll!views::internal::MenuRunnerImpl::RunMenuAt(views::Widget * parent, views::MenuButtonController * button_controller, const gfx::Rect & bounds, views::MenuAnchorPosition anchor, int run_types, aura::Window * native_view_for_gestures) Line 184 C++
views.dll!views::internal::MenuRunnerImplAdapter::RunMenuAt(views::Widget * parent, views::MenuButtonController * button_controller, const gfx::Rect & bounds, views::MenuAnchorPosition anchor, int types, aura::Window * native_view_for_gestures) Line 40 C++
views.dll!views::MenuRunner::RunMenuAt(views::Widget * parent, views::MenuButtonController * button_controller, const gfx::Rect & bounds, views::MenuAnchorPosition anchor, ui::MenuSourceType source_type, aura::Window * native_view_for_gestures) Line 82 C++
libcef.dll!CefMenuRunnerViewsNative::RunContextMenu(AlloyBrowserHostImpl * browser, CefMenuModelImpl * model, const content::ContextMenuParams & params) Line 34 C++
libcef.dll!CefMenuManager::CreateContextMenu(const content::ContextMenuParams & params) Line 199 C++
Context menu behavior on Linux is still a bit broken in cefclient.
--multi-threaded-message-loop
or --use-views
alloy: Use Views context menus on Windows/Linux (fixes issue #3330)
→ <<cset 7a372a642b77 (bb)>>
The following tests are flaky (mostly failing) on Linux at M112 due to the context menu appearing in the wrong location (offset right/down). Clicking on the button a 2nd time (manually) causes the menu to appear in the expected location.
[ FAILED ] ViewsButtonTest.MenuButtonClickFramedWithTextWithImageFramelessWindow
[ FAILED ] ViewsButtonTest.MenuButtonClickFramedWithTextNoImageFramelessWindow
[ FAILED ] ViewsButtonTest.MenuButtonClickFramedNoTextWithImageFramelessWindow
[ FAILED ] ViewsButtonTest.MenuButtonClickFramelessWithTextWithImageFramelessWindow
[ FAILED ] ViewsButtonTest.MenuButtonClickFramelessWithTextNoImageFramelessWindow
[ FAILED ] ViewsButtonTest.MenuButtonClickFramelessNoTextWithImageFramelessWindow
[ FAILED ] ViewsButtonTest.MenuButtonClickFramelessNoTextNoImageFramelessWindow
Reopening due to issues on Linux.
Original report by me.
Views is used on Windows/Linux (windowed mode) to create the browser. We should also use Views to create the context menu and remove the platform-specific implementation on Windows. This will also provide default Views menus for OSR clients.