Reversion of previous fix for Mac OS X scrollwheel,

it appears I used 10.7+ options, fails for 10.6.

Back to drawing board!
This commit is contained in:
Ton Roosendaal
2012-12-28 16:11:04 +00:00
parent 74a30d91d2
commit 357b02f65f
2 changed files with 24 additions and 4 deletions

View File

@@ -293,6 +293,9 @@ protected:
*/
GHOST_TInt32 m_cursorDelta_x, m_cursorDelta_y;
/** Multitouch trackpad availability */
bool m_hasMultiTouchTrackpad;
};
#endif // __GHOST_SYSTEMCOCOA_H__

View File

@@ -548,6 +548,7 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
int mib[2];
struct timeval boottime;
size_t len;
char *rstring = NULL;
m_modifierMask =0;
m_cursorDelta_x=0;
@@ -565,7 +566,25 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
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;
}
@@ -1560,9 +1579,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSScrollWheel:
{
/* proper detection of trackpad or mouse scrollwheel */
if ([event momentumPhase] == NSEventPhaseNone && [event phase] == NSEventPhaseNone) {
if (!m_hasMultiTouchTrackpad) {
GHOST_TInt32 delta;
double deltaF = [event deltaY];