Only mac needs to call SetActive

This commit is contained in:
Cheng Zhao 2018-03-06 13:32:56 +09:00
parent 4c7b48e596
commit e7f175d578

View file

@ -364,18 +364,22 @@ void BrowserWindow::OnWindowEndSession() {
void BrowserWindow::OnWindowBlur() {
web_contents()->StoreFocus();
#if defined(OS_MACOSX)
auto* rwhv = web_contents()->GetRenderWidgetHostView();
if (rwhv)
rwhv->SetActive(false);
#endif
Emit("blur");
}
void BrowserWindow::OnWindowFocus() {
web_contents()->RestoreFocus();
#if defined(OS_MACOSX)
auto* rwhv = web_contents()->GetRenderWidgetHostView();
if (rwhv)
rwhv->SetActive(true);
#endif
Emit("focus");
}