CGDisplayHideCursor and -[NSWindow toggleFullScreen] don't get along on Lion

I'm trying to hide the cursor when in full-screen mode on Lion but the CGDisplayHideCursor call immediately takes the display out of full-screen mode. It doesn't matter which call comes first, I get the same result every time.

> I'm trying to hide the cursor when in full-screen mode on Lion but the CGDisplayHideCursor call immediately takes the display out of full-screen mode. It doesn't matter which call comes first, I get the same result every time.

> On Jan 2, 2012, at 10:30 AM, Michael Crawford wrote:
> >> I'm trying to hide the cursor when in full-screen mode on Lion but the CGDisplayHideCursor call immediately takes the display out of full-screen mode. It doesn't matter which call comes first, I get the same result every time.>
> Works fine here.
>
>
>
> --
> Seth Willits

Still works fine. Can you repeat it in a sample project that I can test?

On Jan 2, 2012, at 11:27 AM, Michael Crawford wrote:

> Seth, don't run from inside Xcode. Start the app from the finder. I find that in that instance, it goes to full screen and then immediately exits full screen.
>
>
> -Michael
>
> On Jan 2, 2012, at 1:52 PM, Seth Willits wrote:
> >> On Jan 2, 2012, at 10:30 AM, Michael Crawford wrote:
>> >>> I'm trying to hide the cursor when in full-screen mode on Lion but the CGDisplayHideCursor call immediately takes the display out of full-screen mode. It doesn't matter which call comes first, I get the same result every time.>>
>> Works fine here.
>>

> On Jan 2, 2012, at 11:27 AM, Michael Crawford <michaelacrawford...> wrote:
> >> Seth, don't run from inside Xcode. Start the app from the finder. I find that in that instance, it goes to full screen and then immediately exits full screen.>
> Try launching with Shift held down to clear restorable window state.
>
> --Kyle Sluder

Seth, I appreciate your offer to help out by testing some code. Now that Kyle has identified what is going on, I'm looking into programmatically disabling or overriding the window restoration behavior for my app.

For the benefit of anyone else who is watching and also has limited experience with some of the new Lion features, a call to [NSWindow setRestorable:] or flipping a switch in the interface builder UI for the NSWindow instance, handily solves the problem.

-Michael

On Jan 2, 2012, at 4:56 PM, Michael Crawford wrote:

> Seth, I appreciate your offer to help out by testing some code. Now that Kyle has identified what is going on, I'm looking into programmatically disabling or overriding the window restoration behavior for my app.
>
> -Michael
>
> On Jan 2, 2012, at 4:44 PM, Michael Crawford wrote:
> >> Thank you, Kyle. That works.
>>
>> -Michael
>>
>> On Jan 2, 2012, at 3:16 PM, Kyle Sluder wrote:
>> >>> On Jan 2, 2012, at 11:27 AM, Michael Crawford <michaelacrawford...> wrote:
>>> >>>> Seth, don't run from inside Xcode. Start the app from the finder. I find that in that instance, it goes to full screen and then immediately exits full screen.>>>
>>> Try launching with Shift held down to clear restorable window state.
>>>
>>> --Kyle Sluder

I'm curious. I swapped out my calls to CGDisplayHideCursor and CGDisplayShowCursor with +[NSCursor hide] and +[NSCursor unhide], respectively. Same behavior. I wanted to know if one called the other so I set a breakpoint on the CGDisplay methods and called the NSCursor methods. They don't appear to be layered.

I'm curious to know, what if any differences there are between the two sets of calls? What advantage if any does one set have over the other?

-Michael

On Jan 2, 2012, at 5:11 PM, Michael Crawford wrote:

> For the benefit of anyone else who is watching and also has limited experience with some of the new Lion features, a call to [NSWindow setRestorable:] or flipping a switch in the interface builder UI for the NSWindow instance, handily solves the problem.
>
> -Michael
>
> On Jan 2, 2012, at 4:56 PM, Michael Crawford wrote:
> >> Seth, I appreciate your offer to help out by testing some code. Now that Kyle has identified what is going on, I'm looking into programmatically disabling or overriding the window restoration behavior for my app.
>>
>> -Michael
>>
>> On Jan 2, 2012, at 4:44 PM, Michael Crawford wrote:
>> >>> Thank you, Kyle. That works.
>>>
>>> -Michael
>>>
>>> On Jan 2, 2012, at 3:16 PM, Kyle Sluder wrote:
>>> >>>> On Jan 2, 2012, at 11:27 AM, Michael Crawford <michaelacrawford...> wrote:
>>>> >>>>> Seth, don't run from inside Xcode. Start the app from the finder. I find that in that instance, it goes to full screen and then immediately exits full screen.>>>>
>>>> Try launching with Shift held down to clear restorable window state.
>>>>
>>>> --Kyle Sluder