Add workaround for crash on popup window creation (see issue #3040)
This commit is contained in:
parent
71179da2f6
commit
2a64387259
|
@ -364,12 +364,13 @@ bool AlloyBrowserHostImpl::TryCloseBrowser() {
|
|||
}
|
||||
|
||||
void AlloyBrowserHostImpl::SetFocus(bool focus) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::BindOnce(&AlloyBrowserHostImpl::SetFocus, this, focus));
|
||||
return;
|
||||
}
|
||||
// Always execute asynchronously to work around issue #3040.
|
||||
CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::SetFocusInternal,
|
||||
this, focus));
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::SetFocusInternal(bool focus) {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (focus)
|
||||
OnSetFocus(FOCUS_SOURCE_SYSTEM);
|
||||
else if (platform_delegate_)
|
||||
|
|
|
@ -370,6 +370,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
|||
void InitializeDevToolsRegistrationOnUIThread(
|
||||
CefRefPtr<CefRegistration> registration);
|
||||
|
||||
void SetFocusInternal(bool focus);
|
||||
|
||||
CefWindowHandle opener_;
|
||||
const bool is_windowless_;
|
||||
const bool is_views_hosted_;
|
||||
|
|
Loading…
Reference in New Issue