From f553f20cc73ca644e400546f9fef705ed814990e Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 13 Mar 2013 12:37:22 +0100 Subject: [PATCH] Change criterion for focusing find string when dialog is open We now move focus to the find string unless the window is visible, key, and focus is already in a text field (technically an NSTextView). --- Frameworks/Find/src/FindWindowController.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frameworks/Find/src/FindWindowController.mm b/Frameworks/Find/src/FindWindowController.mm index 9f56c281..315f8cfd 100644 --- a/Frameworks/Find/src/FindWindowController.mm +++ b/Frameworks/Find/src/FindWindowController.mm @@ -525,9 +525,9 @@ static NSButton* OakCreateButton (NSString* label, NSBezelStyle bezel = NSRounde - (void)showWindow:(id)sender { - BOOL isVisible = [self isWindowLoaded] && [self.window isVisible]; + BOOL isVisibleAndKey = [self isWindowLoaded] && [self.window isVisible] && [self.window isKeyWindow]; [super showWindow:sender]; - if(!isVisible) + if(!isVisibleAndKey || ![[self.window firstResponder] isKindOfClass:[NSTextView class]]) [self.window makeFirstResponder:self.findTextField]; }