> On Dec 11, 2014, at 6:53 AM, Ken Thomases <k...@codeweavers.com> wrote:
> 
> This was never a good strategy.  That notification does not necessarily only 
> occur when the user changes screen resolution or rearranges the displays.  As 
> I mentioned, it happens when the Dock changes size or if the user toggles its 
> auto-hide behavior.  It could happen when a system with dual GPUs switches 
> between them.  Etc.
> 
> You should move the window minimally to keep it within the visible frame of 
> its screen.  Or you might use a heuristic where you identify the closest 
> edges and maintain the distance from those edges.  In most cases, this will 
> mean not moving it at all, which is good.


I believe I mentioned previously that my testing showed that adding and 
removing icons from the Dock did not trigger the 
-applicationDidChangeScreenParameters: delegate method. I was right as to the 
Mac I tested, but the conclusion I drew was erroneous because I tested on a Mac 
with so many icons already in the Dock that the Dock doesn't change size. I now 
see that the delegate method is in fact triggered by such things as changing 
the Dock's size, position on screen and autohide preference settings, all 
affecting the NSScreen 'visibleFrame'. 

Unfortunately, the documentation gives us very little guidance as to what the 
delegate method does and does not cover. I still don't know what it is in my 
rewritten application that is triggering the delegate method. I know it isn't 
the addition of the application's icon to the Dock when I launch the 
application, for two reasons: (1) my Dock has so many icons in it that adding 
an icon does not change its height and in fact does not trigger the delegate 
method; and (2) my application's icon is always kept in the dock anyway whether 
or not it is running.

You're right that the delegate method can be triggered by changes that my 
application does not care about. As I mentioned in another message this 
morning, I am therefore currently rewriting the application to keep track of 
relevant screen parameters in user defaults and to respond only to changes in 
the number and size of screens and to changes in which screen has the menu bar 
(the first screen in the 'screens' list; I mischaracterized it as the "main" 
screen in my previous post). That should resolve the difficulty I brought up in 
my original post as well as the difficulty you pointed out regarding changes to 
the NSScreen 'visibleFrame'.

I will not respond to your comments on application design choices, as they are 
not the subject of my question.

-- 

Bill Cheeseman - b...@cheeseman.name

_______________________________________________

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

Reply via email to