Skip to content

Commit

Permalink
Make sure the dependencies list gets hidden on 2008/2009 machines by …
Browse files Browse the repository at this point in the history
…deferring the early return in the process list update routine until after the menu items are hidden.
  • Loading branch information
codykrieger committed Jun 25, 2012
1 parent ce3d3b8 commit 8d6712f
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Classes/GSMenuController.m
Expand Up @@ -137,7 +137,7 @@ - (void)updateMenu
else
GTMLoggerInfo(@"%@ in use. Bummer! Less battery life for you.", [GSGPU discreteGPUName]);

if (![GSGPU isLegacyMachine] && !isUsingIntegrated)
if (!isUsingIntegrated)
[self _updateProcessList];
}

Expand Down Expand Up @@ -247,24 +247,21 @@ - (void)_localizeMenu

- (void)_updateProcessList
{
// If we're using a 9400M/9600M GT model, no need to display/update the
// dependencies list.
if ([GSGPU isLegacyMachine])
return;

for (NSMenuItem *menuItem in [statusMenu itemArray]) {
if ([menuItem indentationLevel] > 0 && ![menuItem isEqual:processList])
[statusMenu removeItem:menuItem];
}

BOOL isUsingIntegrated = [GSMux isUsingIntegratedGPU];

[processList setHidden:isUsingIntegrated];
[processesSeparator setHidden:isUsingIntegrated];
[dependentProcesses setHidden:isUsingIntegrated];

// No point in updating the list if it isn't visible.
if (isUsingIntegrated)

BOOL hide = isUsingIntegrated || [GSGPU isLegacyMachine];
[processList setHidden:hide];
[processesSeparator setHidden:hide];
[dependentProcesses setHidden:hide];

// If we're using a 9400M/9600M GT model, or if we're on the integrated GPU,
// no need to display/update the dependencies list.
if (hide)
return;

GTMLoggerDebug(@"Updating process list...");
Expand Down

0 comments on commit 8d6712f

Please sign in to comment.