Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2012-12-28 20:11:04 +0400
committerTon Roosendaal <ton@blender.org>2012-12-28 20:11:04 +0400
commit357b02f65ff31392fd3b0b8a875af73bcd7977c9 (patch)
treef0d4b4c26eb684fb131de4cb509ac1b2bd279109 /intern
parent74a30d91d20531dc257179362654ec205ca6894c (diff)
Reversion of previous fix for Mac OS X scrollwheel,
it appears I used 10.7+ options, fails for 10.6. Back to drawing board!
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.h3
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm25
2 files changed, 24 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index 8598bd0862f..a1b372dac9a 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -293,6 +293,9 @@ protected:
*/
GHOST_TInt32 m_cursorDelta_x, m_cursorDelta_y;
+ /** Multitouch trackpad availability */
+ bool m_hasMultiTouchTrackpad;
+
};
#endif // __GHOST_SYSTEMCOCOA_H__
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 742bf944946..39fd038d568 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -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];