Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Focus webview directly in offscreen mode (#12507)
  • Loading branch information
brenca authored and zcbenz committed Apr 5, 2018
1 parent c1404ff commit 52b1065
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions atom/browser/api/atom_api_browser_window.cc
Expand Up @@ -512,11 +512,19 @@ void BrowserWindow::Close() {
}

void BrowserWindow::Focus() {
window_->Focus(true);
if (api_web_contents_->IsOffScreen()) {
FocusOnWebView();
} else {
window_->Focus(true);
}
}

void BrowserWindow::Blur() {
window_->Focus(false);
if (api_web_contents_->IsOffScreen()) {
BlurWebView();
} else {
window_->Focus(false);
}
}

bool BrowserWindow::IsFocused() {
Expand Down

0 comments on commit 52b1065

Please sign in to comment.