[NSCursor unhide];
}
-void Cocoa_HideDock()
+//---------------------------------------------------------------------------------
+void SetMenuBarVisible2(bool visible)
{
- // Find which display we are on
- NSOpenGLContext* context = [NSOpenGLContext currentContext];
- if (context)
+ if(visible)
{
- NSView* view;
-
- view = [context view];
- if (view)
- {
- NSWindow* window;
- window = [view window];
- if (window)
- {
- NSDictionary* screenInfo = [[window screen] deviceDescription];
- NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"];
- if (kCGDirectMainDisplay == (CGDirectDisplayID)[screenID longValue])
- {
- CStdString tmp_str;
-
- // keep the dock hidden using applescriptif on main screen with the dock.
- tmp_str = "tell application \"System Events\" \n";
- tmp_str += "keystroke \"d\" using {command down, option down} \n";
- tmp_str += "end tell \n";
-
- Cocoa_DoAppleScript( tmp_str.c_str() );
- }
- }
- }
+ [[NSApplication sharedApplication]
+ setPresentationOptions: NSApplicationPresentationDefault];
+ }
+ else
+ {
+ [[NSApplication sharedApplication]
+ setPresentationOptions: NSApplicationPresentationHideMenuBar |
+ NSApplicationPresentationHideDock];
}
}