Permalink
Browse files

Merge pull request #940 from pjrobertson/toggle

Make the 'toggle' action smarter - fixes #939
  • Loading branch information...
2 parents 59255b0 + 1e8cf41 commit dbc139058d2ab14d3f7bc1623e0f3efea604e6c3 @skurfer skurfer committed Jun 19, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 Quicksilver/Code-QuickStepCore/QSProcessSource.m
View
10 Quicksilver/Code-QuickStepCore/QSProcessSource.m
@@ -125,13 +125,13 @@ - (QSObject *)toggleApplication:(QSObject *)dObject {
NSArray *array = [dObject arrayForType:QSProcessType];
//NSLog(@"arr %@", array);
if (array) {
- if ([[NSWorkspace sharedWorkspace] applicationIsHidden:[array lastObject]]) {
+ if ([[NSWorkspace sharedWorkspace] applicationIsFrontmost:[array lastObject]]) {
// NSLog(@"showing");
- [[NSWorkspace sharedWorkspace] performSelector:@selector(activateApplication:) onObjectsInArray:array
- returnValues:NO];
+ [[NSWorkspace sharedWorkspace] performSelector:@selector(hideApplication:) onObjectsInArray:array
+ returnValues:NO];
} else {
- [[NSWorkspace sharedWorkspace] performSelector:@selector(hideApplication:) onObjectsInArray:array
- returnValues:NO];
+ [[NSWorkspace sharedWorkspace] performSelector:@selector(activateApplication:) onObjectsInArray:array
+ returnValues:NO];
}
} else {
array = [dObject validPaths];

0 comments on commit dbc1390

Please sign in to comment.