On Aug 23, 2012, at 8:55 AM, Trygve Inda <cocoa...@xericdesign.com> wrote:

> Very occasionally when my MyDisplayReconfigurationCallBack is called:
> 
> void DisplayReconfigurationCallBack (CGDirectDisplayID cgDisplayID,
> CGDisplayChangeSummaryFlags flags, void *userInfo)
> 
> The system sends me a nil value for cgDisplayID
> 
> When I try to cycle through the array of NSScreen to find the one that
> matches cgDisplayID it never finds it since 0 is not a valid cgDisplayID.
> 
> What is causing this?
> 
> I mostly see it on Thunderbolt Macs

Interesting. My similar callback function doesn't really pay attention to the 
display ID parameter passed in, so a nil value wouldn't be a problem.

Any notable pattern to the flags value in these cases?

There is a kCGNullDirectDisplay constant (CGDirectDisplay.h), although it is 
rarely referenced in the header file comments or documentation (seems to be 
used as an invalid/not applicable return value, or a cancel/disable flag on 
input, where referenced). A couple of the old Carbon HIWindow API's used it to 
denote the main display on input. Not sure why it is returned or what it means 
in the context of the reconfiguration callback.



_______________________________________________

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