views: Support configuration of initial window show state

Known issues:
- Exiting full-screen mode currently crashes with the Chrome runtime
  (see issue #3182).
This commit is contained in:
Marshall Greenblatt
2021-09-07 17:04:55 +03:00
parent 2b40cab3fe
commit dc1f934865
16 changed files with 147 additions and 17 deletions

View File

@@ -218,9 +218,15 @@ void CefBrowserPlatformDelegateViews::SendTouchEvent(
}
void CefBrowserPlatformDelegateViews::SendFocusEvent(bool setFocus) {
// Will result in a call to WebContents::Focus().
if (setFocus && browser_view_->root_view())
// Will activate the Widget and result in a call to WebContents::Focus().
if (setFocus && browser_view_->root_view()) {
if (auto widget = GetWindowWidget()) {
// Don't activate a minimized Widget, or it will be shown.
if (widget->IsMinimized())
return;
}
browser_view_->root_view()->RequestFocus();
}
}
gfx::Point CefBrowserPlatformDelegateViews::GetScreenPoint(