[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53367] trunk/blender/intern/ghost/intern: Bugfix #33681

Ton Roosendaal ton at blender.org
Fri Dec 28 13:48:51 CET 2012


Revision: 53367
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53367
Author:   ton
Date:     2012-12-28 12:48:45 +0000 (Fri, 28 Dec 2012)
Log Message:
-----------
Bugfix #33681

Blender didn't detect properly whether event came from a mouse-wheel or
from a trackpad in OS X.

Now you can both, and both are handled independently.

Removed back hack from 2 years ago - which disabled mouse wheel for laptops.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h
    trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h	2012-12-28 12:12:04 UTC (rev 53366)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.h	2012-12-28 12:48:45 UTC (rev 53367)
@@ -293,9 +293,6 @@
 	 */
 	GHOST_TInt32 m_cursorDelta_x, m_cursorDelta_y;
 	
-	/** Multitouch trackpad availability */
-	bool m_hasMultiTouchTrackpad;
-	
 };
 
 #endif // __GHOST_SYSTEMCOCOA_H__

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2012-12-28 12:12:04 UTC (rev 53366)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemCocoa.mm	2012-12-28 12:48:45 UTC (rev 53367)
@@ -548,7 +548,6 @@
 	int mib[2];
 	struct timeval boottime;
 	size_t len;
-	char *rstring = NULL;
 	
 	m_modifierMask =0;
 	m_cursorDelta_x=0;
@@ -566,25 +565,7 @@
 	
 	sysctl(mib, 2, &boottime, &len, NULL, 0);
 	m_start_time = ((boottime.tv_sec*1000)+(boottime.tv_usec/1000));
-	
-	//Detect multitouch trackpad
-	mib[0] = CTL_HW;
-	mib[1] = HW_MODEL;
-	sysctl( mib, 2, NULL, &len, NULL, 0 );
-	rstring = (char*)malloc( len );
-	sysctl( mib, 2, rstring, &len, NULL, 0 );
-	
-	//Hack on MacBook revision, as multitouch avail. function missing
-	//MacbookAir or MacBook version >= 5 (retina is MacBookPro10,1)
-	if (strstr(rstring,"MacBookAir") ||
-		(strstr(rstring,"MacBook") && (rstring[strlen(rstring)-3]>='5') && (rstring[strlen(rstring)-3]<='9')) ||
-		(strstr(rstring,"MacBook") && (rstring[strlen(rstring)-4]>='1') && (rstring[strlen(rstring)-4]<='9')))
-		m_hasMultiTouchTrackpad = true;
-	else m_hasMultiTouchTrackpad = false;
-	
-	free( rstring );
-	rstring = NULL;
-	
+		
 	m_ignoreWindowSizedMessages = false;
 }
 
@@ -1579,7 +1560,9 @@
 			
 		case NSScrollWheel:
 			{
-				if (!m_hasMultiTouchTrackpad) {
+				
+				/* proper detection of trackpad or mouse scrollwheel */
+				if ([event momentumPhase] == NSEventPhaseNone && [event phase] == NSEventPhaseNone) {
 					GHOST_TInt32 delta;
 					
 					double deltaF = [event deltaY];




More information about the Bf-blender-cvs mailing list