From a4b6ef577e8910ec77b43af79a5034dd24aa6c20 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 18 Oct 2019 14:24:29 +0200 Subject: [PATCH] Don't set "always on top" style for child CefWindows. As of https://crrev.com/9e653328e3 the Views framework will apply the "always on top" (WS_EX_TOPMOST) style by default to widgets created with TYPE_MENU. CEF uses this type in CefWindowView::CreateWidget to support child windows that are not clipped to the parent window bounds (currently indicated by returning a parent window from CefWindowDelegate::GetParentWindow and setting |is_menu| to true). Not setting "always on top" shouldn't be a problem except in cases where some other window is already "always on top" and the child CefWindow is expected to overlay that window. For this reason any menus created using ShowMenu will continue to have the "always on top" style. --- libcef/browser/views/window_view.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 69b4113da..de8cc3a57 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -268,6 +268,10 @@ void CefWindowView::CreateWidget() { if (is_menu) { // Don't clip the window to parent bounds. params.type = views::Widget::InitParams::TYPE_MENU; + + // Don't set "always on top" for the window. + params.z_order = ui::ZOrderLevel::kNormal; + can_activate = can_activate_menu; if (can_activate_menu) params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;