Re: Window positioning and screen resizing
Re: Window positioning and screen resizing
- Subject: Re: Window positioning and screen resizing
- From: John Joyce <email@hidden>
- Date: Tue, 14 May 2013 16:09:13 +0900
On 2013/05/14, at 9:57, Rick Mann <email@hidden> wrote:
> It seems that Cocoa or the OS or someone repositions my windows with some rules when the screen resolution changes. Does anyone know what the rules are? Stuff is kept in roughly the same quadrant of the screen, near as I can tell, and perhaps the offset within the quadrant is adjusted by some factor, but it seems to be repeatable (that is, windows don't crawl with repeated changes).
>
> Is this documented somewhere? I couldn't even think of how to search for this (my feeble attempts turned up nothing).
>
> --
> Rick
>
>
NSApplication class has a notification you can observe:
NSApplicationDidChangeScreenParametersNotification
Posted when the configuration of the displays attached to the computer is changed.
The configuration change can be made either programmatically or when the user changes settings in the Displays control panel. The notification object is sharedApplication. This notification does not contain a userInfo dictionary.
Then you can respond according to your app's needs.
Presumably, you should not rely on or infer the logic of what the system does for you, but rather just respond as appropriate for your own needs.
_______________________________________________
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