mac: Send focus/blur event to devtools web contents.
This commit is contained in:
parent
a6627a7286
commit
c58bf15345
1 changed files with 26 additions and 0 deletions
|
@ -148,4 +148,30 @@ using namespace brightray;
|
||||||
inspectableWebContentsView_->inspectable_web_contents()->CloseDevTools();
|
inspectableWebContentsView_->inspectable_web_contents()->CloseDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)windowDidBecomeMain:(NSNotification*)notification {
|
||||||
|
content::WebContents* web_contents =
|
||||||
|
inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
|
||||||
|
if (!web_contents)
|
||||||
|
return;
|
||||||
|
|
||||||
|
web_contents->RestoreFocus();
|
||||||
|
|
||||||
|
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
||||||
|
if (rwhv)
|
||||||
|
rwhv->SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)windowDidResignMain:(NSNotification*)notification {
|
||||||
|
content::WebContents* web_contents =
|
||||||
|
inspectableWebContentsView_->inspectable_web_contents()->devtools_web_contents();
|
||||||
|
if (!web_contents)
|
||||||
|
return;
|
||||||
|
|
||||||
|
web_contents->StoreFocus();
|
||||||
|
|
||||||
|
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
||||||
|
if (rwhv)
|
||||||
|
rwhv->SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue