diff options
author | Sven Gothel <[email protected]> | 2015-09-26 06:28:51 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-09-26 06:28:51 +0200 |
commit | 3d2765f0bb752debd7784f717eeac4c9eb500d5a (patch) | |
tree | dfc79669805282428750e0527941adf18de8bbec /src/newt/native/NewtMacWindow.m | |
parent | 5270971814c27e4a7019a9e3c15fcad42fedb9c3 (diff) |
Bug 1222 - NEWT OSX: setAlwaysOnTop() and setAlwaysOnBottom() not working
- The NSWindow level must be set at window creation
- Levels are
- aontop: kCGMaximumWindowLevel
- aonbottom: kCGDesktopIconWindowLevel (w/ input)
- normal: NSNormalWindowLevel
- Hence we need to recreate the NSWindow if toggling the state,
similar to opaque .. etc.
Diffstat (limited to 'src/newt/native/NewtMacWindow.m')
-rw-r--r-- | src/newt/native/NewtMacWindow.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m index 70dc5969b..86c4490ed 100644 --- a/src/newt/native/NewtMacWindow.m +++ b/src/newt/native/NewtMacWindow.m @@ -932,6 +932,20 @@ NS_ENDHANDLER return realized; } +- (void) setAlwaysOn: (BOOL)top bottom:(BOOL)bottom +{ + if( top ) { + DBG_PRINT( "*************** setAlwaysOn -> top\n"); + [self setLevel: kCGMaximumWindowLevel]; + } else if ( bottom ) { + DBG_PRINT( "*************** setAlwaysOn -> bottom\n"); + [self setLevel: kCGDesktopIconWindowLevel]; // w/ input + } else { + DBG_PRINT( "*************** setAlwaysOn -> normal\n"); + [self setLevel:NSNormalWindowLevel]; + } +} + - (void) updateInsets: (JNIEnv*) env jwin: (jobject) javaWin { NSRect frameRect = [self frame]; |