• 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: Rob Petrovec via Cocoa-dev <email@hidden>
  • Date: Thu, 8 Jun 2023 11:45:19 -0600

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
> <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)
>
> 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

_______________________________________________

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

  • Follow-Ups:
    • Re: NSScreen.screens under multiple displays
      • From: Gabriel Zachmann via Cocoa-dev <email@hidden>
References: 
 >NSScreen.screens under multiple displays (From: Gabriel Zachmann 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