mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Backport to work on Leopard as well
This commit is contained in:
parent
5c644b7543
commit
4017e1897d
@ -20,6 +20,11 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <OpenGL/CGLRenderers.h>
|
||||
|
||||
#ifndef kCGLRendererIDMatchingMask
|
||||
// For older versions of Mac OS X
|
||||
#define kCGLRendererIDMatchingMask 0x00FE7F00
|
||||
#endif
|
||||
|
||||
TypeHandle CocoaGraphicsStateGuardian::_type_handle;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -748,7 +748,9 @@ set_properties_now(WindowProperties &properties) {
|
||||
if (_window != nil) {
|
||||
// For some reason, setting the style mask
|
||||
// makes it give up its first-responder status.
|
||||
[_window setStyleMask:NSBorderlessWindowMask];
|
||||
if ([_window respondsToSelector:@selector(setStyleMask:)]) {
|
||||
[_window setStyleMask:NSBorderlessWindowMask];
|
||||
}
|
||||
[_window makeFirstResponder:_view];
|
||||
[_window setLevel:NSMainMenuWindowLevel+1];
|
||||
[_window makeKeyAndOrderFront:nil];
|
||||
@ -889,7 +891,8 @@ set_properties_now(WindowProperties &properties) {
|
||||
// However, if we're specifying the 'undecorated' property also,
|
||||
// then we'll be setting the style mask about 25 LOC further down,
|
||||
// so we won't need to bother setting it here.
|
||||
if (!properties.has_undecorated() && !_properties.get_undecorated()) {
|
||||
if (!properties.has_undecorated() && !_properties.get_undecorated() &&
|
||||
[_window respondsToSelector:@selector(setStyleMask:)]) {
|
||||
if (properties.get_fixed_size()) {
|
||||
[_window setStyleMask:NSTitledWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask ];
|
||||
@ -904,7 +907,7 @@ set_properties_now(WindowProperties &properties) {
|
||||
properties.clear_fixed_size();
|
||||
}
|
||||
|
||||
if (properties.has_undecorated() && _window != nil) {
|
||||
if (properties.has_undecorated() && _window != nil && [_window respondsToSelector:@selector(setStyleMask:)]) {
|
||||
_properties.set_undecorated(properties.get_undecorated());
|
||||
|
||||
if (!_properties.get_fullscreen()) {
|
||||
|
@ -16,7 +16,11 @@
|
||||
|
||||
class CocoaGraphicsWindow;
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||
@interface CocoaPandaWindowDelegate : NSObject<NSWindowDelegate> {
|
||||
#else
|
||||
@interface CocoaPandaWindowDelegate : NSObject {
|
||||
#endif
|
||||
@private
|
||||
CocoaGraphicsWindow *_graphicsWindow;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user