Only mac needs to call SetActive
This commit is contained in:
parent
4c7b48e596
commit
e7f175d578
1 changed files with 4 additions and 0 deletions
|
@ -364,18 +364,22 @@ void BrowserWindow::OnWindowEndSession() {
|
||||||
|
|
||||||
void BrowserWindow::OnWindowBlur() {
|
void BrowserWindow::OnWindowBlur() {
|
||||||
web_contents()->StoreFocus();
|
web_contents()->StoreFocus();
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
auto* rwhv = web_contents()->GetRenderWidgetHostView();
|
auto* rwhv = web_contents()->GetRenderWidgetHostView();
|
||||||
if (rwhv)
|
if (rwhv)
|
||||||
rwhv->SetActive(false);
|
rwhv->SetActive(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
Emit("blur");
|
Emit("blur");
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindow::OnWindowFocus() {
|
void BrowserWindow::OnWindowFocus() {
|
||||||
web_contents()->RestoreFocus();
|
web_contents()->RestoreFocus();
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
auto* rwhv = web_contents()->GetRenderWidgetHostView();
|
auto* rwhv = web_contents()->GetRenderWidgetHostView();
|
||||||
if (rwhv)
|
if (rwhv)
|
||||||
rwhv->SetActive(true);
|
rwhv->SetActive(true);
|
||||||
|
#endif
|
||||||
|
|
||||||
Emit("focus");
|
Emit("focus");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue