Return NSWindow to Normal Level

Posted by PF1 on Stack Overflow See other posts from Stack Overflow or by PF1
Published on 2010-06-13T22:24:34Z Indexed on 2010/06/13 22:32 UTC
Read the original article Hit count: 211

Filed under:
|
|
|
|

Hi Everyone:

I have an NSWindow that I want to go above the captured kCGDirectMainDisplay when a function is run and have the window go back to its normal level after the display is released. My code works for capturing the display, setting the window's level, and releasing the display, however once the display is released, the window floats above all other windows. I have included my method of doing this, in case I am doing something wrong.

Capture the display

CGDisplayCapture(kCGDirectMainDisplay); 
[self.window setLevel:CGShieldingWindowLevel()];

Release the display

CGDisplayRelease(kCGDirectMainDisplay)
[self.window setLevel:NSNormalWindowLevel];

Thanks for any help!

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about display