mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Fixed focus stealing bug
git-svn-id: http://macvim.googlecode.com/svn/trunk@275 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
+11
-3
@@ -119,7 +119,9 @@ static NSTimeInterval MMTerminateTimeout = 3;
|
||||
{
|
||||
// NOTE! This way it possible to start the app with the command-line
|
||||
// argument '-nowindow yes' and no window will be opened by default.
|
||||
return ![[NSUserDefaults standardUserDefaults] boolForKey:MMNoWindowKey];
|
||||
untitledWindowOpening =
|
||||
![[NSUserDefaults standardUserDefaults] boolForKey:MMNoWindowKey];
|
||||
return untitledWindowOpening;
|
||||
}
|
||||
|
||||
- (BOOL)applicationOpenUntitledFile:(NSApplication *)sender
|
||||
@@ -436,8 +438,14 @@ static NSTimeInterval MMTerminateTimeout = 3;
|
||||
[vimControllers addObject:vc];
|
||||
|
||||
// HACK! MacVim does not get activated if it is launched from the
|
||||
// terminal, so we forcibly activate here.
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
// terminal, so we forcibly activate here unless it is an untitled window
|
||||
// opening (i.e. MacVim was opened from the Finder). Untitled windows are
|
||||
// treated differently, else MacVim would steal the focus if another app
|
||||
// was activated while the untitled window was loading.
|
||||
if (!untitledWindowOpening)
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
untitledWindowOpening = NO;
|
||||
|
||||
return vc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user