Identifying monitor configurations
Identifying monitor configurations
- Subject: Identifying monitor configurations
- From: Rick Mann <email@hidden>
- Date: Tue, 26 Feb 2013 00:51:12 -0800
I'd like for my app to be able to restore the location of its windows based on the display configuration. For example, if you have a MacBook Pro and a Cinema Display to its left, and you put a window on one of those displays, I want to remember that window's geometry for that config.
If you then remove the external monitor, the window will move (if necessary) to the remaining display. If the user moves it again, I want to remember that position for that display config.
If the user then reattaches the external monitor, I want to be able to recall the old geometry and restore the window to that location.
If they add a different external display, that's a new configuration.
One way to do this is to iterate the displays using CGGetActiveDisplayList(), use CGDisplayVendorNumber() for each, sort them, build a string, and use that as a key into a dictionary of geometries. Maybe add the screen geometry to the string, in case vendor IDs overlap or are unknown.
But I want to check to see if there's not already a better solution in place, or just a better idea.
Thanks!
--
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden