Windows: Fix hidden dropdowns when the window is topmost (issue #1468)

Also add a --always-on-top flag to cefclient to allow easier testing of this
behavior on Windows and Linux.
This commit is contained in:
Isaac Devine
2018-02-28 17:47:36 +13:00
committed by Marshall Greenblatt
parent 1928572b52
commit c64898f9fc
19 changed files with 85 additions and 9 deletions

View File

@@ -194,8 +194,15 @@ bool CefBrowserPlatformDelegateNativeWin::CreateHostWindow() {
point =
gfx::ToFlooredPoint(gfx::ScalePoint(gfx::PointF(point), 1.0f / scale));
// Stay on top if top-most window hosting the web view is topmost.
HWND top_level_window = GetAncestor(window_info_.window, GA_ROOT);
DWORD top_level_window_ex_styles =
GetWindowLongPtr(top_level_window, GWL_EXSTYLE);
bool always_on_top =
(top_level_window_ex_styles & WS_EX_TOPMOST) == WS_EX_TOPMOST;
CefWindowDelegateView* delegate_view =
new CefWindowDelegateView(GetBackgroundColor());
new CefWindowDelegateView(GetBackgroundColor(), always_on_top);
delegate_view->Init(window_info_.window, browser_->web_contents(),
gfx::Rect(0, 0, point.x(), point.y()));