Only show the open dialog if the application is active

This fixes an issue where command line arguments were not passed because
the repository was already opened.
This commit is contained in:
Pieter de Bie
2008-09-12 14:32:15 +02:00
parent 42e8196e1f
commit 9b6695e3a0
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
// Only try to open a default document if there are no documents open already.
// For example, the application might have been launched by double-clicking a .git repository,
// or by dragging a folder to the app icon
if ([[[PBRepositoryDocumentController sharedDocumentController] documents] count] == 0) {
if ([[[PBRepositoryDocumentController sharedDocumentController] documents] count] == 0 && [[NSApplication sharedApplication] isActive]) {
// Try to open the current directory as a git repository
NSURL *url = nil;
if([[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"])
+4 -1
View File
@@ -23,7 +23,10 @@ int main(int argc, const char** argv)
if (!proxy) {
// If the connection failed, try to launch the app
[[NSWorkspace sharedWorkspace] launchApplication:@"GitX"];
[[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier: @"nl.frim.GitX"
options: NSWorkspaceLaunchWithoutActivation
additionalEventParamDescriptor: nil
launchIdentifier: nil];
// Now attempt to connect, allowing the app time to startup
for (int attempt = 0; proxy == nil && attempt < 50; ++attempt){