Remove focus from CEF when AtomController resigns as main window. Add focus when it becomes the main window.

This commit is contained in:
Corey Johnson
2012-06-26 09:55:52 -07:00
committed by Nathan Sobo
parent 7387ad13f6
commit b673d40fd5

View File

@@ -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<CefV8Context> context = _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();