• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Identifying monitor configurations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Programmatic autolayout problem
  • Next by Date: Re: NSButton in NSToolbarItem does not use "small size"
  • Previous by thread: Re: Programmatic autolayout problem
  • Next by thread: Issue of NSStatusBar
  • Index(es):
    • Date
    • Thread