@private
atom::NativeWindowMac* shell_;
BOOL acceptsFirstMouse_;
+ BOOL hasSetInitialFocus_;
}
- (id)initWithShell:(atom::NativeWindowMac*)shell;
- (void)setAcceptsFirstMouse:(BOOL)accept;
if ((self = [super init])) {
shell_ = shell;
acceptsFirstMouse_ = NO;
+ hasSetInitialFocus_ = NO;
}
return self;
}
- (void)windowDidBecomeMain:(NSNotification*)notification {
shell_->NotifyWindowFocus();
+
+ // Make sure the web view is the first responder of the window.
+ if (!hasSetInitialFocus_) {
+ shell_->GetWebContents()->GetView()->Focus();
+ hasSetInitialFocus_ = YES;
+ }
}
- (void)windowDidResignMain:(NSNotification*)notification {