Never send blur events to specs window

This makes sure that specs that rely on focus behavior don't end up failing because our focus is on an entirely different window.
This commit is contained in:
Nathan Sobo
2012-07-02 19:41:12 -06:00
parent 8fbbd77a23
commit 0433d3c3d9
2 changed files with 3 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ class ClientHandler;
NSView *_devToolsView;
NSString *_bootstrapScript;
NSString *_pathToOpen;
bool _runningSpecs;
CefRefPtr<CefV8Context> _atomContext;
CefRefPtr<ClientHandler> _clientHandler;

View File

@@ -37,6 +37,7 @@
}
- (id)initSpecsWithAtomContext:(CefRefPtr<CefV8Context>)atomContext {
_runningSpecs = true;
return [self initWithBootstrapScript:@"spec-bootstrap" atomContext:atomContext];
}
@@ -130,7 +131,7 @@
#pragma mark NSWindowDelegate
- (void)windowDidResignMain:(NSNotification *)notification {
if (_clientHandler && _clientHandler->GetBrowser()) {
if (_clientHandler && _clientHandler->GetBrowser() && !_runningSpecs) {
_clientHandler->GetBrowser()->SendFocusEvent(false);
}
}