Re: NSScreen.screens under multiple displays

2023-06-10 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot.

But different displays/monitors will count as different screens,
no matter if "Displays have separate Spaces" is on or off?

Best regards, Gabriel


> On 8. Jun 2023, at 19:45, Rob Petrovec  wrote:
>
> The order of the screens can change under various user scenarios.  One easy 
> one is simply re-arranging the displays, or even moving the menu bar thing 
> from one display to another in the Arrange UI Displays prefs pane. Obviously 
> plugging & unplugging displays or closing a laptop with an external display 
> will change it too. You should not assume the index of the screen your window 
> is on, if that is what you were thinking.  Hope that helps.
>
> —Rob



smime.p7s
Description: S/MIME cryptographic signature
___

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


Re: NSScreen.screens under multiple displays

2023-06-08 Thread Jeff Szuhay via Cocoa-dev
>resending from correct email address<


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

CGError 
 
CGGetOnlineDisplayList( uint32_t  maxDisplays, 
CGDirectDisplayID 

 *onlineDisplays, 
uint32_t *displayCount);

see 
>

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 
> mailto:cocoa-dev@lists.apple.com>> 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 
>> mailto:cocoa-dev@lists.apple.com>> 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 (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/zav%40mac.com 
>> 
>> 
>> This email sent to z...@mac.com
> 
> ___
> 
> 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/jeff%40szuhay.org 
> 
> 
> This email sent to j...@szuhay.org

___

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


Re: NSScreen.screens under multiple displays

2023-06-08 Thread Rob Petrovec via Cocoa-dev
The order of the screens can change under various user scenarios.  One easy one 
is simply re-arranging the displays, or even moving the menu bar thing from one 
display to another in the Arrange UI Displays prefs pane. Obviously plugging & 
unplugging displays or closing a laptop with an external display will change it 
too. You should not assume the index of the screen your window is on, if that 
is what you were thinking.  Hope that helps.

—Rob


> On Jun 8, 2023, at 10:53 AM, Gabriel Zachmann via Cocoa-dev 
>  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 (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/petrock%40mac.com
> 
> This email sent to petr...@mac.com

___

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


Re: NSScreen.screens under multiple displays

2023-06-08 Thread Alex Zavatone via Cocoa-dev
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 
>  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 (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/zav%40mac.com
> 
> This email sent to z...@mac.com

___

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


NSScreen.screens under multiple displays

2023-06-08 Thread Gabriel Zachmann via Cocoa-dev
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



smime.p7s
Description: S/MIME cryptographic signature
___

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