comparison mac/dw.m @ 950:73ff2daed8ca

Attempt at fixing mouse button detection on Leopard for Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 01 May 2011 03:31:40 +0000
parents 451c71b7fdb1
children 7193401d139a
comparison
equal deleted inserted replaced
949:451c71b7fdb1 950:73ff2daed8ca
117 #if !defined(GARBAGE_COLLECT) 117 #if !defined(GARBAGE_COLLECT)
118 pthread_key_t _dw_pool_key; 118 pthread_key_t _dw_pool_key;
119 #endif 119 #endif
120 pthread_key_t _dw_fg_color_key; 120 pthread_key_t _dw_fg_color_key;
121 pthread_key_t _dw_bg_color_key; 121 pthread_key_t _dw_bg_color_key;
122 SInt32 DWOSMajor, DWOSMinor, DWOSBuild;
122 123
123 /* Create a default colors for a thread */ 124 /* Create a default colors for a thread */
124 void _init_colors(void) 125 void _init_colors(void)
125 { 126 {
126 NSColor *fgcolor = [[NSColor grayColor] retain]; 127 NSColor *fgcolor = [[NSColor grayColor] retain];
278 } 279 }
279 /* Motion notify event */ 280 /* Motion notify event */
280 case 5: 281 case 5:
281 { 282 {
282 int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction; 283 int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))handler->signalfunction;
283 int buttonmask = (int)[NSEvent pressedMouseButtons]; 284 int buttonmask = DWOSMinor > 5 ? (int)[NSEvent pressedMouseButtons] : 0;
284 id view = [[[event window] contentView] superview]; 285 id view = [[[event window] contentView] superview];
285 NSPoint p = [view convertPoint:[event locationInWindow] toView:object]; 286 NSPoint p = [view convertPoint:[event locationInWindow] toView:object];
287
288 if(DWOSMinor < 6)
289 {
290 buttonmask = (1 << [event buttonNumber]);
291 }
286 292
287 return motionfunc(object, (int)p.x, (int)[object frame].size.height - p.y, buttonmask, handler->data); 293 return motionfunc(object, (int)p.x, (int)[object frame].size.height - p.y, buttonmask, handler->data);
288 } 294 }
289 /* Window close event */ 295 /* Window close event */
290 case 6: 296 case 6:
427 HMTX DWRunMutex; 433 HMTX DWRunMutex;
428 HMTX DWThreadMutex; 434 HMTX DWThreadMutex;
429 HMTX DWThreadMutex2; 435 HMTX DWThreadMutex2;
430 DWTID DWThread = (DWTID)-1; 436 DWTID DWThread = (DWTID)-1;
431 DWTID _dw_mutex_locked = (DWTID)-1; 437 DWTID _dw_mutex_locked = (DWTID)-1;
432 SInt32 DWOSMajor, DWOSMinor, DWOSBuild;
433 438
434 /* Used for doing bitblts from the main thread */ 439 /* Used for doing bitblts from the main thread */
435 typedef struct _bitbltinfo 440 typedef struct _bitbltinfo
436 { 441 {
437 id src; 442 id src;