How to create a HUD overlay in full screen?

Can I add a HUD overlay for a Cocoa application that runs in full screen?
I switch to full screen as follows.

// An NSView.
[self enterFullScreenMode:m_screen withOptions:nil];

The HUD overlay has the type NSPaneland element of the presentation above. To display the HUD, I run the following lines of code.

[m_hudPanel setFloatingPanel:YES];
[m_hudPanel orderFront:self];
[m_hudPanel orderWindow:NSWindowAbove relativeTo:[[self window] windowNumber]];
[m_hudPanel makeKeyAndOrderFront:self];
[m_hudPanel makeFirstResponder:self];

Although the panel does not appear until I exit full screen mode.

+3
source share
1 answer

You need to increase the window level. I don't know about -enterFullScreenMode:withOptions, but with the full-screen CoreGraphics API we did it like this:

int level = CGShieldingWindowLevel();
[m_hudPanel setLevel:level];

, , level + 1, . , , . , . , , , - , ( ).

+2

All Articles