> On Dec 13, 2022, at 13:50, Gabriel Zachmann via Cocoa-dev
> wrote:
>
> I am not interested in detecting whether or not my screensaver is running in
> System Prefs preview.
>
> I am interested in the *screen* on which I am running, irrespective of
> whether it's inside System Prefs or as a f
>
> I mentioned somewhere in one of my replies that you know when it?s being run
> in the System Prefs preview because isPreview is passed to the main entry
> point.
>
>
I am not interested in detecting whether or not my screensaver is running in
System Prefs preview.
I am interested in the *s
I mentioned somewhere in one of my replies that you know when it’s being run in
the System Prefs preview because isPreview is passed to the main entry point.
Steve via iPad
> On Dec 11, 2022, at 14:56, Gabriel Zachmann via Cocoa-dev
> wrote:
>
> Thanks again for the responses. And sorry for
Thanks again for the responses. And sorry for following up so much later.
(a bit of context is recapped below)
First of all, thanks for the hint to viewDidMoveToWindow.
So, currently , I do this in my viewDidMoveToWindow:
- (void) viewDidMoveToWindow
{
window_ = [self window];
NSUIntege
> On Nov 17, 2022, at 16:11, Gabriel Zachmann via Cocoa-dev
> wrote:
>
> Thanks a lot for your quick responses!
>
> I would like to understand what you are saying and what is going on, so
> please bear with me.
>
> So, Steve, if I understand correctly, you suggest to write:
>
> - (void) vie
Thanks a lot for your quick responses!
I would like to understand what you are saying and what is going on, so please
bear with me.
So, Steve, if I understand correctly, you suggest to write:
- (void) viewWillMoveToWindow: (NSWindow *) newWindow
{
unsigned long my_screen = [NSScreen.screen
> On Nov 17, 2022, at 11:59, Jack Brindle via Cocoa-dev
> wrote:
>
> The NSScreen screen property is nullable. From the docs for NSWindow screen:
>
> "The value of this property is the screen where most of the window is on; it
> is nil when the window is offscreen."
If a screensaver window
The NSScreen screen property is nullable. From the docs for NSWindow screen:
"The value of this property is the screen where most of the window is on; it is
nil when the window is offscreen."
I would go with Steve’s suggestion as much as possible, The NSScreen class has
the info you need.
Jac
> On Nov 17, 2022, at 10:44, Gabriel Zachmann via Cocoa-dev
> wrote:
>
> In my screensaver (macOS),
> I am trying to retrieve the 'screen number' (NSScreenNumber) for the screen
> on which I am running.
[NSScreen.screens indexOfObject:window.screen] gives you the zero-based screen
index. 0
In my screensaver (macOS),
I am trying to retrieve the 'screen number' (NSScreenNumber) for the screen on
which I am running.
So, in
- (void) viewWillMoveToWindow: (NSWindow *) newWindow
I have this line of code:
displayID_ = [ [[newWindow screen] deviceDescription] objectForKey:
@"NSS
10 matches
Mail list logo