Focus webview directly in offscreen mode (#12507)

This commit is contained in:
Heilig Benedek 2018-04-05 08:14:42 +02:00 committed by Cheng Zhao
parent c1404ff2c1
commit 52b1065b3b

View file

@ -512,11 +512,19 @@ void BrowserWindow::Close() {
} }
void BrowserWindow::Focus() { void BrowserWindow::Focus() {
window_->Focus(true); if (api_web_contents_->IsOffScreen()) {
FocusOnWebView();
} else {
window_->Focus(true);
}
} }
void BrowserWindow::Blur() { void BrowserWindow::Blur() {
window_->Focus(false); if (api_web_contents_->IsOffScreen()) {
BlurWebView();
} else {
window_->Focus(false);
}
} }
bool BrowserWindow::IsFocused() { bool BrowserWindow::IsFocused() {