On May 20, 2014, at 1:59 AM, Matthias Dörfelt wrote: > AFAIK there is no way to find retina display modes with Quartz Display > Services right now. Why is that? Is there any workaround or different API? > Right now, if I change the Display Mode of my retina display > programmatically, I have to cache the original retina display mode in order > to return to it, as > CGDisplayCopyAllDisplayModes won’t expose them to me. > Are we still waiting for a proper public API to handle these things or am I > fundamentally misunderstanding something here?
It's not that you're misunderstanding, it's that the new capability has not been documented well. It's only listed in the headers. In /System/Library/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGDirectDisplay.h you'll find the declaration of kCGDisplayShowDuplicateLowResolutionModes. That's a key that can be used in the options dictionary parameter of CGDisplayCopyAllDisplayModes(). Use the value kCFBooleanTrue. There are also new functions to get the dimensions of a display mode in pixels rather than points: CGDisplayModeGetPixelWidth() and CGDisplayModeGetPixelHeight(). Without these, you may mistake a HiDPI display mode as a normal one, since its dimensions will be reported in points. For what it's worth, I found that the old, deprecated display mode APIs (e.g. CGDisplayAvailableModes()) list all of the display modes with no special flags or options. Regards, Ken _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com