Skip to content

Commit

Permalink
Add delay for searchbox focus as workaround on Sierra
Browse files Browse the repository at this point in the history
  • Loading branch information
TermiT committed Dec 21, 2016
1 parent c26f4df commit fe5bb21
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 26 deletions.
4 changes: 2 additions & 2 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ -(void)menuWillOpen:(NSMenu *)menu
menuOpenEvent = [event retain]; // So we can send it again to open the menu.
[menu cancelTracking]; // Prevent the menu from displaying, since activateIgnoringOtherApps would close it anyway.
[NSApp activateIgnoringOtherApps: YES]; // Required to make the search field firstResponder any good.
[self performSelector:@selector(reopenMenu) withObject:nil afterDelay:0.0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; // Because we really do want the menu open.
[self performSelector:@selector(reopenMenu) withObject:nil afterDelay:0.2 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; // Because we really do want the menu open.
}
else
{
// Flycut is now active, so set the first responder once the menu opens.
[self performSelector:@selector(activateSearchBox) withObject:nil afterDelay:0.0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
[self performSelector:@selector(activateSearchBox) withObject:nil afterDelay:0.2 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
}
}
}
Expand Down
40 changes: 16 additions & 24 deletions English.lproj/MainMenu.nib/designable.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown.

0 comments on commit fe5bb21

Please sign in to comment.