diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-28 16:48:45 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-28 16:48:45 +0400 |
commit | 9f9e35c82a7c96e6f3a20b379f48109f4f8f03de (patch) | |
tree | fb6cad4e49a36dc2e7cdd2398a745b033dc9045f /intern | |
parent | c04631f0bb716583e4678add34d09ac3494515ea (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.h | 3 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 25 |
2 files changed, 4 insertions, 24 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h index a1b372dac9a..8598bd0862f 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.h +++ b/intern/ghost/intern/GHOST_SystemCocoa.h @@ -293,9 +293,6 @@ 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 39fd038d568..742bf944946 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -548,7 +548,6 @@ GHOST_SystemCocoa::GHOST_SystemCocoa() int mib[2]; struct timeval boottime; size_t len; - char *rstring = NULL; m_modifierMask =0; m_cursorDelta_x=0; @@ -566,25 +565,7 @@ 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; } @@ -1579,7 +1560,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) 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]; |