mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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:
@@ -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"])
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user