OSX 10.6 error - hiding code behind a respondsToSelector.
authorTon Roosendaal <ton@blender.org>
Tue, 22 Jan 2013 19:06:51 +0000 (19:06 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 22 Jan 2013 19:06:51 +0000 (19:06 +0000)
intern/ghost/intern/GHOST_WindowCocoa.mm

index 43d3dcb..0ce04c5 100644 (file)
@@ -921,12 +921,15 @@ NSScreen* GHOST_WindowCocoa::getScreen()
 /* called for event, when window leaves monitor to another */
 void GHOST_WindowCocoa::setNativePixelSize(void)
 {
-       NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
-       
-       GHOST_Rect rect;
-       getClientBounds(rect);
+       /* make sure 10.6 keeps running */
+       if ([m_openGLView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
+               NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
+               
+               GHOST_Rect rect;
+               getClientBounds(rect);
 
-       m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
+               m_nativePixelSize = (float)backingBounds.size.width / (float)rect.getWidth();
+       }
 }
 
 /**