Re: Screen <--> View Coordinate system conversion
Re: Screen <--> View Coordinate system conversion
- Subject: Re: Screen <--> View Coordinate system conversion
- From: Ken Thomases <email@hidden>
- Date: Tue, 19 Jan 2016 21:45:21 -0600
On Jan 19, 2016, at 6:30 PM, Graham Cox <email@hidden> wrote:
>
> OK, I got this working - thanks for all the help.
>
> There is a follow-up issue though. On 10.11 (others not yet tried), the drawing only appears on the main screen. When I make my transparent window, I size it to the union of all NSScreens, thinking that would cover the entire desktop no matter how many screens I have. Obviously, I need to do more to make this work across multiple monitors, but I’m not sure what. This has always worked in the (distant) past, but probably the changes to screen behaviour from 10.9 has nixed that.
>
> What shoudl I be looking for to make an overlay window that will work across any number of screens, and also back to the older OS versions? (10.7 at least).
You can't reliably make a window which spans multiple screens. You have to use a separate window for each screen and draw the same way to each (with proper coordinate transforms). This has been true, as you noted, since 10.9. If "Displays have separate Spaces" is enabled in System Preferences, windows are simply clipped to their screen, which is determined either by which screen holds the majority of their area or, if they were dragged by the user, which screen the cursor was on when the drag ended.
<https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#10_9Spaces>
Regards,
Ken
_______________________________________________
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