codykrieger/gfxCardStatus — pull request #107 by highandfew (2013-03-14 13:51:53+00:00)
Title: Fixed an issue for 2010 MBP users

Hi Cody,

I'm a 2010 MBP user. I have been a fan of your app for a long time, using it to force the Integrated Only mode. The problem is that the mode will change to Discrete Only after certain apps which use Core Graphics close, such as Chrome or iOS Simulator.

The few lines of code I've added in fixes this problem:
- Created a static variable in GSMux to note which mode the user has selected
- In the displayConfigurationCallback section in GSGPU.m, if the user has selected Integrated Only but the discrete graphics is on, there will be a call to [GSMux setMode:] to change it back to Integrated Only.
- Do note that forceSwitch doesn't help in this case, since it resolves any discrepancy to the system mode, while my solution resolves it to the user's preference, which is how it should be.

Btw, I have also read that you have selected Dynamic Switching to default upon login so that the app runs smoothly. I think a better solution would be to first select Dynamic Switching to ensure the smoothness, then change it immediately afterwards to the user's last selected preference. What do you think?