Skip to content

Instantly share code, notes, and snippets.

@atiti
Created May 23, 2014 06:43
Show Gist options
  • Save atiti/62cd1d104a920c63e71b to your computer and use it in GitHub Desktop.
Save atiti/62cd1d104a920c63e71b to your computer and use it in GitHub Desktop.
CGDirectDisplayID display[32];
uint32_t displayCount = 0;
CGGetActiveDisplayList(32, display, &displayCount);
for(int i = 0; i < displayCount; i++) {
io_service_t service = CGDisplayIOServicePort(display[i]);
CFStringRef nameRef = IORegistryEntryCreateCFProperty(service, CFSTR("CFBundleIdentifier"), kCFAllocatorDefault, 0);
if(CFStringCompare(nameRef, CFSTR("info.ennowelbers.framebuffer"), 0)==0) {
// success! - display[i] is the display using the proxy framebuffer
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment