Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGDisplayBounds() with stacked displays...




On Nov 1, 2007, at 7:56 PM, Mike McNamara wrote:

At 6:57 PM -0700 11/1/07, Shawn Erickson wrote:

I am confused by what you state in the above... CGDisplayBounds
returns a CGRect that outlines the bounds in global coordinates for
the display ID you supply it. It doesn't return display IDs nor
kCGNullDirectDisplay.

My apologies for not explaining properly... I am getting a point from the current display the mouse is located on, calling CGGetDisplaysWithPoint() for the point and then passing the returned display ID to CGDisplayBounds(). In the case that the secondary display is above or below the primary one CGGetDisplaysWithPoint() returns null -- and of course my call to CGDisplayBounds as a result returns nothing.


So I guess it's more the case that CGGetDisplaysWithPoint() doesn't appear to function as I would expect for stacked displays.

Are you sure the coordinate space of the mouse coordinates is correct? How are you getting the mouse coordinates?


I suggest you use CG calls to get a list of active displays and iterate over that list to output the bounds for all of the displays. Then take a look at the mouse coordinates you are attempting to use and see if the fall in the rects you got.

-Shawn
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: CGDisplayBounds() with stacked displays... (From: "Shawn Erickson" <email@hidden>)
 >Re: CGDisplayBounds() with stacked displays... (From: Mike McNamara <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.