• 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
Re: CGDisplayBounds() with stacked displays...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGDisplayBounds() with stacked displays...


  • Subject: Re: CGDisplayBounds() with stacked displays...
  • From: Mike McNamara <email@hidden>
  • Date: Thu, 1 Nov 2007 22:02:44 -0600

At 8:08 PM -0700 11/1/07, Shawn Erickson wrote:

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

I'm 99.9% certain the mouse coordinates are correct. I've tried using both:

NSPoint windowPosition = [[self window] mouseLocationOutsideOfEventStream];
NSPoint location = [[self window] convertBaseToScreen:windowPosition];

and:

[NSEvent mouseLocation]

Of course I then convert the NSPoint to a CGPoint and pass it to CGGetDisplaysWithPoint() to get the display ID(s).

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.

Good advice. Thank you. In fact using CGGetActiveDisplayList() and passing those ID's to CGDisplayBounds() appears to return the expected bounds for each display. So assuming my mouse coordinates are correct anyway, I can check the display vs. those bounds.



Mike

_______________________________________________

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


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

  • Prev by Date: Re: [Leopard] Core Data model versioning vs. NSPersistentDocument
  • Next by Date: Re: Learning a word with the spell checker
  • Previous by thread: Re: CGDisplayBounds() with stacked displays...
  • Next by thread: Re: Calendar control
  • Index(es):
    • Date
    • Thread