MacBook's Switchable Graphics to toggle by script - macos

Recently I had a problem with Photoshop CS4 but I solved the problem by turning off switchable graphics in System Preferences.
Is there any way to toggle switchable graphics with a program?

The best tool for this is Cody Krieger's gfxCardStatus, which not only allows forcing the setting from the menu bar, but also does a fine job of monitoring why your system has switched GPU modes.

Related

How can I programmatically attach/detach displays in Windows 10?

I'm wondering if there's a good way to automate changing my display configuration in Windows 10?
I have 3 monitors attached, and I find myself wanting to configure my system in one of 3 ways:
All monitors set up to extend the desktop.
Only my central (largest) monitor enabled, others both disabled.
Only my right-most monitor enabled, others both disabled (I think hook up a spare HDMI cable on my center monitor to my laptop, and the monitor automatically switches to that input).
Manually, this involves opening the Display Settings panel, selecting the monitors, and either marking them as "Disconnected" or "Extend desktop on this display".
Is there some nice, scripting-friendly way to do this? I'm more comfortable doing this sorta thing on Linux, where I'd whip up a quick shell script to call the xrandr command a few times, or something like that...

Screens flicker when calling glViewport after window style was changed

In my OpenGL application I switch between windowed and fullscreen mode using
Raymond Chen's solution:
http://blogs.msdn.com/b/oldnewthing/archive/2010/04/12/9994016.aspx
This works apart from two very annoying side effects when used in a
multi-monitor setup (only):
After the window mode was switched BOTH screens flicker/flash just in the
moment glViewport is called to accommodate the changed window dimensions.
Windows on the desktop from other applications are not painted correctly
after the switch until I e.g. minimize/maximize them (or do something similar
to force a refresh).
Does one know these effects and maybe also knows a solution?
ps: further tests showed that this only happens on my PC with an AMD card but not with my Nvidia card. If only one monitor is active it doesn't happen at all.

Windows: Programatically determine if hardware acceleration can be disabled

Our application includes a screen capture capability. Some applications use overlay surfaces to display video so we included an option to disable hardware acceleration in order to force those applications into software rendering mode so that we can screen cap them. This worked fine under Windows XP.
However, under Windows 7 it appears, from my research, that very few display drivers support the ability to disable hardware acceleration since the DWM uses DirectX9 rendering. On those sysetms the Display Settings->Advanced Settings->Troubleshoot->Change Settings... button is disabled. But I have heard reports that on some systems that button is enabled.
So, my question is what API (or heuristic) is the windows control panel using to enable/disable the "Change settings..." button so that I can enable/disable a similar control in our application?

Win7 and multiple monitors: switch focus when moving mouse to different monitor?

I recently upgraded to a dual monitor setup at work, and while the extra real estate is very nice, there's one annoyance: my intuitive reaction is that there are two "active" windows now, namely the topmost window in each monitor -- and I frequently get surprised when keyboard events go to the actual active window, rather than the one I've moused over and am looking at.
There's a setting in the control panel that gives this effect (ease of access -> make the mouse easier to use -> activate a window by hovering over it with the mouse) but it also acts on windows within the same monitor, which I don't want.
I frequently use my ThinkPad's scrolling function on unfocused windows which I don't want to receive focus, which come to think of it probably adds to my confusion, since I can scroll my email in the other window but my keyboard shortcuts don't go there.
Is there any way to achieve this effect or am I just wishing?
Thanks,
Ryan
Yeah, get a Mac :-p
In all seriousness OS X does provide this functionality. It might be worth searching for an add on that does the same sort of thing. I know of Wizmouse -- http://antibody-software.com/web/software/software/wizmouse-makes-your-mouse-wheel-work-on-the-window-under-the-mouse/
There might be more though.
AT LAST!!! Windows 10 has this support :-)
SM
You can change the settings to use classic windows appearance etc. and try to focus on the border color of the window. The board changes on the active window.
I use two monitors and there really isn't much you can do besides change your behavior.
Select things from the taskbar, drag active windows to the same screen and always refer to inactive windows by moving them to the inactive windows monitor and remember to go back to the window you want to be active.

Simplest way to blank the Macintosh display until a key is pressed?

What is the simplest way to blank a Macintosh screen (completely black) and unblank it only on keystroke (not mouse movement)? I'm happy to pursue any of these implementations:
Create a completely custom program that blanks the screen (or turns off the display) and awaits a keystroke. (A short gcc/g++ program would be great....)
Create (or locate) a standard "System Preferences" screensaver that ignores mouse events
Some configuration trick that makes the existing screensaver system ignore mouse events
A third-party app, free or commercial
No fancy screensaver graphics wanted - just a blank screen.
I'm an experienced developer (Linux, Windows) but have never written for the Mac. Thank you very much.
Based on your comments on CajunLuke's answer, why not just turn off screen brightness completely when not in use? As far as I know, all Mac keyboards have screen brightness buttons, so you could use them to quickly turn on/off screen brightness when you want to.
Control-Shift-Eject should do what you want. If you have a screensaver password set up, it'll ask for that, too.

Resources