[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54009] trunk/blender/intern/ghost/intern/ GHOST_WindowCocoa.mm: OSX 10. 6 error - hiding code behind a respondsToSelector.

Ton Roosendaal ton at blender.org
Tue Jan 22 20:06:52 CET 2013


Revision: 54009
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54009
Author:   ton
Date:     2013-01-22 19:06:51 +0000 (Tue, 22 Jan 2013)
Log Message:
-----------
OSX 10.6 error - hiding code behind a respondsToSelector.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2013-01-22 18:42:16 UTC (rev 54008)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowCocoa.mm	2013-01-22 19:06:51 UTC (rev 54009)
@@ -921,12 +921,15 @@
 /* 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();
+	}
 }
 
 /**




More information about the Bf-blender-cvs mailing list