Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
DockWidget: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
billziss-gh committed Nov 18, 2019
1 parent b11cbdb commit 040b75f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Widgets/DockWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 172,7 @@ - (void)setProminent:(BOOL)value

- (void)bounce
{
if (!_appLaunching)
if (!_appLaunching || nil == self.superview)
return;

[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context)
Expand Down Expand Up @@ -1137,15 1137,25 @@ - (void)launchApp:(NSString *)path pid:(pid_t)pid
BOOL activated = FALSE;
if (0 != pid)
{
NSRunningApplication *runningApp = [NSRunningApplication
runningApplicationWithProcessIdentifier:pid];
int count = 0;
for (DockWidgetApplication *app in self.apps)
if (nil != app.path && [path isEqualToString:app.path])
count ;
if (1 < count)
{
NSRunningApplication *runningApp = [NSRunningApplication
runningApplicationWithProcessIdentifier:pid];
activated = [runningApp activateWithOptions:NSApplicationActivateIgnoringOtherApps];
else
{
NSNumber *value;
BOOL isApp =
[runningApp.bundleURL getResourceValue:&value forKey:NSURLIsApplicationKey error:0] &&
[value boolValue];
if (!isApp)
activated = [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:runningApp.bundleIdentifier
options:NSWorkspaceLaunchDefault
additionalEventParamDescriptor:nil
launchIdentifier:0];
}
}
if (!activated && nil != path)
Expand Down

0 comments on commit 040b75f

Please sign in to comment.