# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1304220700 0 # Node ID 73ff2daed8ca124f8e4d21070c4a9c38163cad22 # Parent 451c71b7fdb11ab2cfcc3109db8b05da8c999efb Attempt at fixing mouse button detection on Leopard for Mac. diff -r 451c71b7fdb1 -r 73ff2daed8ca mac/dw.m --- a/mac/dw.m Sun May 01 01:10:44 2011 +0000 +++ b/mac/dw.m Sun May 01 03:31:40 2011 +0000 @@ -119,6 +119,7 @@ #endif pthread_key_t _dw_fg_color_key; pthread_key_t _dw_bg_color_key; +SInt32 DWOSMajor, DWOSMinor, DWOSBuild; /* Create a default colors for a thread */ void _init_colors(void) @@ -280,9 +281,14 @@ case 5: { int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; - int buttonmask = (int)[NSEvent pressedMouseButtons]; + int buttonmask = DWOSMinor > 5 ? (int)[NSEvent pressedMouseButtons] : 0; id view = [[[event window] contentView] superview]; NSPoint p = [view convertPoint:[event locationInWindow] toView:object]; + + if(DWOSMinor < 6) + { + buttonmask = (1 << [event buttonNumber]); + } return motionfunc(object, (int)p.x, (int)[object frame].size.height - p.y, buttonmask, handler->data); } @@ -429,7 +435,6 @@ HMTX DWThreadMutex2; DWTID DWThread = (DWTID)-1; DWTID _dw_mutex_locked = (DWTID)-1; -SInt32 DWOSMajor, DWOSMinor, DWOSBuild; /* Used for doing bitblts from the main thread */ typedef struct _bitbltinfo