Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef MAC_OS_X_VERSION_10_6
- //Show again menu & dock if needed
- if ([[m_window screen] isEqual:[NSScreen mainScreen]])
- {
- [NSApp setPresentationOptions:NSApplicationPresentationDefault];
- }
- //Make window normal and resize it
- [m_window setStyleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)];
- [m_window setFrame:[[m_window screen] visibleFrame] display:YES];
- //TODO for 10.6 only : window title is forgotten after the style change
- [m_window makeFirstResponder:m_openGLView];
- #else
- //With 10.5, we need to create a new window to change its style to borderless
- //Show menu & dock if needed
- if ([[m_window screen] isEqual:[NSScreen mainScreen]])
- {
- //Cocoa function in 10.5 does not allow to set the menu bar in auto-show mode [NSMenu setMenuBarVisible:YES];
- SetSystemUIMode(kUIModeNormal, 0); //One of the very few 64bit compatible Carbon function
- }
- //Create a fullscreen borderless window
- CocoaWindow *tmpWindow = [[CocoaWindow alloc]
- initWithContentRect:[[m_window screen] frame]
- styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)
- backing:NSBackingStoreBuffered
- defer:YES];
- //Copy current window parameters
- [tmpWindow setTitle:[m_window title]];
- [tmpWindow setRepresentedFilename:[m_window representedFilename]];
- [tmpWindow setReleasedWhenClosed:NO];
- [tmpWindow setAcceptsMouseMovedEvents:YES];
- [tmpWindow setDelegate:[m_window delegate]];
- [tmpWindow setSystemAndWindowCocoa:[m_window systemCocoa] windowCocoa:this];
- [tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
- NSStringPboardType, NSTIFFPboardType, nil]];
- //Forbid to resize the window below the blender defined minimum one
- [tmpWindow setContentMinSize:NSMakeSize(320, 240)];
- //Assign the openGL view to the new window
- [tmpWindow setContentView:m_openGLView];
- //Show the new window
- [tmpWindow makeKeyAndOrderFront:nil];
- //Close and release old window
- [m_window setDelegate:nil]; // To avoid the notification of "window closed" event
- [m_window close];
- [m_window release];
- m_window = tmpWindow;
- #endif
Add Comment
Please, Sign In to add comment