-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CGDisplayIOServicePort and SetFrontProcess deprecated on 10.9 #165
Comments
What are the suggested replacements? |
@shurcooL I think there's a replacement for |
from here seems that there's no replacement for NSRunningApplication* app = [NSRunningApplication runningApplicationWithProcessIdentifier: PID];
[app activateWithOptions: NSApplicationActivateAllWindows]; |
There may not be a direct replacement for |
|
|
You can create a matching dictionary for IO services of class "IODisplayConnect" and then use IOServiceGetMatchingServices to iterate over the services - they will map to the connected displays. I've written an implementation (pull request #192) that then compares the product and vendor IDs between the info dictionary for each of those displays and what the CG APIs are returning for the one we're interested in - that should get things right most of the time. I'd use the serial number too but it doesn't appear to be present for all displays. (sorry if that pull request isn't perfectly lining up with the project's coding style - I needed to implement it personally while working on some custom functionality and figured I'd share) |
@mhenr18 Excellent. Will review. |
This replaces CGDisplayIOServicePort with manually finding a service port with matching vendor and product IDs. This may technically not be the one corresponding to the display ID, but it is only used to retrieve the human-readable make/model string. This could be cleaned up and refined a bit by comparing more display attributes when available, but it gets the job done. Fixes #165. Closes #192. Closes #508. Closes #511.
This replaces CGDisplayIOServicePort with manually finding a service port with matching vendor and product IDs. This may technically not be the one corresponding to the display ID, but it is only used to retrieve the human-readable make/model string. This could be cleaned up and refined a bit by comparing more display attributes when available, but it gets the job done. Fixes glfw#165. Closes glfw#192. Closes glfw#508. Closes glfw#511.
This replaces CGDisplayIOServicePort with manually finding a service port with matching vendor and product IDs. This may technically not be the one corresponding to the display ID, but it is only used to retrieve the human-readable make/model string. This could be cleaned up and refined a bit by comparing more display attributes when available, but it gets the job done. Fixes glfw#165. Closes glfw#192. Closes glfw#508. Closes glfw#511.
This replaces CGDisplayIOServicePort with manually finding a service port with matching vendor and product IDs. This may technically not be the one corresponding to the display ID, but it is only used to retrieve the human-readable make/model string. This could be cleaned up and refined a bit by comparing more display attributes when available, but it gets the job done. Fixes glfw#165. Closes glfw#192. Closes glfw#508. Closes glfw#511.
This replaces CGDisplayIOServicePort with manually finding a service port with matching vendor and product IDs. This may technically not be the one corresponding to the display ID, but it is only used to retrieve the human-readable make/model string. This could be cleaned up and refined a bit by comparing more display attributes when available, but it gets the job done. Fixes glfw#165. Closes glfw#192. Closes glfw#508. Closes glfw#511.
Starting from Mavericks 'CGDisplayIOServicePort' and 'SetFrontProcess' are deprecated
the warnings are from:
info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID)
SetFrontProcess(&psn);
The text was updated successfully, but these errors were encountered: