Report focus change on window key (not main)

MacVim should report FocusGained and FocusLost events not just when its
windows become main, but when they become key -- if a panel is opened,
or a background application (i.e. an LSUIElement app) becomes active,
MacVim should reflect the focus state.
This commit is contained in:
Itai Ferber
2016-11-12 15:33:23 -08:00
parent 87243e38ea
commit 2c1841d1d4
+6 -2
View File
@@ -969,7 +969,6 @@
- (void)windowDidBecomeMain:(NSNotification *)notification
{
[[MMAppController sharedInstance] setMainMenu:[vimController mainMenu]];
[vimController sendMessage:GotFocusMsgID data:nil];
if ([vimView textView]) {
NSFontManager *fm = [NSFontManager sharedFontManager];
@@ -977,7 +976,12 @@
}
}
- (void)windowDidResignMain:(NSNotification *)notification
- (void)windowDidBecomeKey:(NSNotificationCenter *)notification
{
[vimController sendMessage:GotFocusMsgID data:nil];
}
- (void)windowDidResignKey:(NSNotification *)notification
{
[vimController sendMessage:LostFocusMsgID data:nil];
}