diff --git a/Atom/src/AtomController.mm b/Atom/src/AtomController.mm index e118054bc..ebc78098b 100644 --- a/Atom/src/AtomController.mm +++ b/Atom/src/AtomController.mm @@ -129,6 +129,17 @@ } #pragma mark NSWindowDelegate +- (void)windowDidResignMain:(NSNotification *)notification { + if (_clientHandler && _clientHandler->GetBrowser()) { + _clientHandler->GetBrowser()->SendFocusEvent(false); + } +} + +- (void)windowDidBecomeMain:(NSNotification *)notification { + if (_clientHandler && _clientHandler->GetBrowser()) { + _clientHandler->GetBrowser()->SendFocusEvent(true); + } +} - (BOOL)windowShouldClose:(id)window { CefRefPtr context = _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();