mac: Emit focus/blur events after page has actually focus/blur-ed.
Otherwise the page would receive the blur event when it has not blured yet. Fixes atom/atom#3124.
This commit is contained in:
parent
fba1772000
commit
6a5f732bba
1 changed files with 4 additions and 4 deletions
|
@ -49,8 +49,6 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidBecomeMain:(NSNotification*)notification {
|
- (void)windowDidBecomeMain:(NSNotification*)notification {
|
||||||
shell_->NotifyWindowFocus();
|
|
||||||
|
|
||||||
content::WebContents* web_contents = shell_->GetWebContents();
|
content::WebContents* web_contents = shell_->GetWebContents();
|
||||||
if (!web_contents)
|
if (!web_contents)
|
||||||
return;
|
return;
|
||||||
|
@ -60,11 +58,11 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
||||||
if (rwhv)
|
if (rwhv)
|
||||||
rwhv->SetActive(true);
|
rwhv->SetActive(true);
|
||||||
|
|
||||||
|
shell_->NotifyWindowFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResignMain:(NSNotification*)notification {
|
- (void)windowDidResignMain:(NSNotification*)notification {
|
||||||
shell_->NotifyWindowBlur();
|
|
||||||
|
|
||||||
content::WebContents* web_contents = shell_->GetWebContents();
|
content::WebContents* web_contents = shell_->GetWebContents();
|
||||||
if (!web_contents)
|
if (!web_contents)
|
||||||
return;
|
return;
|
||||||
|
@ -74,6 +72,8 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
|
||||||
if (rwhv)
|
if (rwhv)
|
||||||
rwhv->SetActive(false);
|
rwhv->SetActive(false);
|
||||||
|
|
||||||
|
shell_->NotifyWindowBlur();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResize:(NSNotification*)otification {
|
- (void)windowDidResize:(NSNotification*)otification {
|
||||||
|
|
Loading…
Add table
Reference in a new issue