mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Only mac needs to call SetActive
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user