@@ -35,11 +35,13 @@ @interface AppDelegate ()
3535@property (weak ) IBOutlet NSMenuItem *miOrderAppName;
3636@property (weak ) IBOutlet NSMenuItem *miOrderLaunchTime;
3737@property (weak ) IBOutlet NSMenuItem *miShowNumberOfWindows;
38+ @property (weak ) IBOutlet NSMenuItem *miShow32BitOnly;
3839
3940@property (assign ) NSInteger iMenuTitle;
4041@property (assign ) NSInteger iIconSmall;
4142@property (assign ) NSInteger iOrder;
4243@property (assign ) NSInteger iShowNumberOfWindows;
44+ @property (assign ) NSInteger iShow32BitOnly;
4345
4446@property (strong , retain ) NSStatusItem *sbItem;
4547@property (strong , retain ) NSMutableArray *apps;
@@ -97,7 +99,7 @@ - (void)changeMenuTitle
9799
98100 switch (self.iMenuTitle ) {
99101 case 0 : {
100- self.sbItem .title = app. localizedName ;
102+ self.sbItem .title = [ self appName: app] ;
101103 self.sbItem .image = nil ;
102104 break ;
103105 }
@@ -114,13 +116,13 @@ - (void)changeMenuTitle
114116 break ;
115117 }
116118 case 3 : {
117- self.sbItem .title = app. localizedName ;
119+ self.sbItem .title = [ self appName: app] ;
118120 self.sbItem .image = [AppDelegate resizeImage: app.icon small: YES
119121 monochrome: NO translucent: NO ];
120122 break ;
121123 }
122124 case 4 : {
123- self.sbItem .title = app. localizedName ;
125+ self.sbItem .title = [ self appName: app] ;
124126 self.sbItem .image = [AppDelegate resizeImage: app.icon small: YES
125127 monochrome: YES translucent: NO ];
126128 break ;
@@ -290,7 +292,7 @@ - (void)createSubmenuOfSwitchMenu {
290292 }
291293 }
292294
293- NSString *title = app. localizedName ;
295+ NSString *title = [ self appName: app] ;
294296 NSMutableArray *windows = [[NSMutableArray alloc ] init ];
295297
296298 NSInteger numWindows = 0 ;
@@ -361,6 +363,18 @@ - (void)createSubmenuOfSwitchMenu {
361363
362364 NSMutableString *tooltip = [[NSMutableString alloc ] init ];
363365 [tooltip appendFormat: @" Full Path:\n %@ \n " ,[app.bundleURL path ]];
366+ NSString *arch;
367+ switch (app.executableArchitecture ) {
368+ case NSBundleExecutableArchitectureI386:
369+ arch = @" i386" ;
370+ break ;
371+ case NSBundleExecutableArchitectureX86_64:
372+ arch = @" x86_64" ;
373+ break ;
374+ default :
375+ arch = @" N/A" ;
376+ }
377+ [tooltip appendFormat: @" \n Executable Architecture:\n %@ \n " , arch];
364378 // [tooltip appendFormat:@"\nBundle Identifier:\n%@\n",app.bundleIdentifier];
365379 if (app.launchDate ) {
366380 [tooltip appendFormat: @" \n Launch Date/Time:\n %@ \n " ,app.launchDate];
@@ -514,26 +528,37 @@ - (NSImage *)makeAllAppsImageMonochrome:(BOOL)monochrome {
514528 return tmpImage;
515529}
516530
531+ - (NSString *)appName : (NSRunningApplication *)app {
532+ if (self.iShow32BitOnly && [app executableArchitecture ] == NSBundleExecutableArchitectureI386) {
533+ return [app.localizedName stringByAppendingString: @" (32-bit)" ];
534+ } else {
535+ return app.localizedName ;
536+ }
537+ }
538+
517539#pragma mark - User Defaults
518540
519541#define UD [NSUserDefaults standardUserDefaults ]
520542#define UDMenuTitle @" MenuTitle"
521543#define UDIconSmall @" IconSmall"
522544#define UDOrder @" Order"
523545#define UDShowNumberOfWindows @" ShowNumberOfWindows"
546+ #define UDShow32BitOnly @" Show32BitOnly"
524547
525548- (void )loadUserDefaults {
526549 self.iMenuTitle = [UD integerForKey: UDMenuTitle];
527550 self.iIconSmall = [UD integerForKey: UDIconSmall];
528551 self.iOrder = [UD integerForKey: UDOrder];
529552 self.iShowNumberOfWindows = [UD integerForKey: UDShowNumberOfWindows];
553+ self.iShow32BitOnly = [UD integerForKey: UDShowNumberOfWindows];
530554}
531555
532556- (void )saveUserDefaults {
533557 [UD setInteger: self .iMenuTitle forKey: UDMenuTitle];
534558 [UD setInteger: self .iIconSmall forKey: UDIconSmall];
535559 [UD setInteger: self .iOrder forKey: UDOrder];
536560 [UD setInteger: self .iShowNumberOfWindows forKey: UDShowNumberOfWindows];
561+ [UD setInteger: self .iShow32BitOnly forKey: UDShow32BitOnly];
537562}
538563
539564- (void )recheckMenuItems {
@@ -553,6 +578,7 @@ - (void)recheckMenuItems {
553578 self.miOrderLaunchTime .state = self.iOrder == 1 ? NSOnState : NSOffState ;
554579
555580 self.miShowNumberOfWindows .state = self.iShowNumberOfWindows > 0 ? NSOnState : NSOffState ;
581+ self.miShow32BitOnly .state = self.iShow32BitOnly > 0 ? NSOnState : NSOffState ;
556582}
557583
558584
@@ -594,6 +620,15 @@ - (IBAction)setShowNumberOfWindows:(NSMenuItem *)sender {
594620 [self saveUserDefaults ];
595621}
596622
623+ - (IBAction )setShow32BitOnly : (NSMenuItem *)sender {
624+ self.iShow32BitOnly = sender.state == NSOnState ? 0 : 1 ;
625+
626+ [self changeMenuTitle ];
627+ [self recheckMenuItems ];
628+ [self createSubmenuOfSwitchMenu ];
629+ [self saveUserDefaults ];
630+ }
631+
597632
598633- (IBAction )actionHideApp : (id )sender {
599634 for (NSRunningApplication *app in self.apps ) {
0 commit comments