• 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: NSScreen.screens under multiple displays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScreen.screens under multiple displays


  • Subject: Re: NSScreen.screens under multiple displays
  • From: Jeff Szuhay via Cocoa-dev <email@hidden>
  • Date: Thu, 8 Jun 2023 14:23:57 -0500

>resending from correct email address<


You may have to go to the Quartz level to get the active display list with

CGError
<https://developer.apple.com/documentation/coregraphics/cgerror?language=objc>
CGGetOnlineDisplayList(         uint32_t  maxDisplays,
                                CGDirectDisplayID
<https://developer.apple.com/documentation/coregraphics/cgdirectdisplayid?language=objc>
 *onlineDisplays,
                                        uint32_t *displayCount);

see
<https://developer.apple.com/documentation/coregraphics/1454964-cggetonlinedisplaylist?language=objc

<https://developer.apple.com/documentation/coregraphics/1454964-cggetonlinedisplaylist?language=objc>>

I have been meaning to do this when I get around to updating my app but I have
not not played with this yet.
Sample code? Sample code? Anyone?


> On Jun 8, 2023, at 12:06 PM, Alex Zavatone via Cocoa-dev
> <email@hidden <mailto:email@hidden>> wrote:
>
> I have a 2 screen system running Ventura and another 3 screen system but not
> under Ventura.
>
> I could build and test for you if you wish.
>
>> On Jun 8, 2023, at 11:53 AM, Gabriel Zachmann via Cocoa-dev
>> <email@hidden <mailto:email@hidden>> wrote:
>>
>> In my method
>>
>>  - (void) viewDidMoveToWindow
>>
>> I have these lines of code:
>>
>>   window_ = [self window];
>>   NSUInteger idx_of_screen = [NSScreen.screens indexOfObject:
>> window_.screen];
>>
>> My question is: will this always produce the same results, whether or not
>> the user has switched "Displays have separate Spaces" on or off (under
>> Desktop & Dock).
>>
>>
>> Best regards, Gabriel
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden
>> <mailto: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
>> <http://lists.apple.com/>
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden
> <mailto: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
> <http://lists.apple.com/>
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

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: 
 >NSScreen.screens under multiple displays (From: Gabriel Zachmann via Cocoa-dev <email@hidden>)
 >Re: NSScreen.screens under multiple displays (From: Alex Zavatone via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: NSScreen.screens under multiple displays
  • Next by Date: Re: NSScreen.screens under multiple displays
  • Previous by thread: Re: NSScreen.screens under multiple displays
  • Next by thread: Re: NSScreen.screens under multiple displays
  • Index(es):
    • Date
    • Thread