comparison mac/dw.m @ 1378:a54720b10821

Fix menu items getting stuck highlighted on Mac if the action triggered a window focus change.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 23 Nov 2011 20:00:17 +0000
parents 52bbb1acce61
children 3ba4853d5b78
comparison
equal deleted inserted replaced
1377:b6249d66404c 1378:a54720b10821
478 478
479 /* Subclass for a test object type */ 479 /* Subclass for a test object type */
480 @interface DWObject : NSObject {} 480 @interface DWObject : NSObject {}
481 -(void)uselessThread:(id)sender; 481 -(void)uselessThread:(id)sender;
482 -(void)synchronizeThread:(id)param; 482 -(void)synchronizeThread:(id)param;
483 -(void)menuHandler:(id)param;
483 -(void)doBitBlt:(id)param; 484 -(void)doBitBlt:(id)param;
484 -(void)doFlush:(id)param; 485 -(void)doFlush:(id)param;
485 @end 486 @end
486 487
487 @implementation DWObject 488 @implementation DWObject
490 { 491 {
491 pthread_mutex_unlock(DWRunMutex); 492 pthread_mutex_unlock(DWRunMutex);
492 pthread_mutex_lock(DWThreadMutex2); 493 pthread_mutex_lock(DWThreadMutex2);
493 pthread_mutex_unlock(DWThreadMutex2); 494 pthread_mutex_unlock(DWThreadMutex2);
494 pthread_mutex_lock(DWRunMutex); 495 pthread_mutex_lock(DWRunMutex);
496 }
497 -(void)menuHandler:(id)param
498 {
499 _event_handler(param, nil, 8);
495 } 500 }
496 -(void)doBitBlt:(id)param 501 -(void)doBitBlt:(id)param
497 { 502 {
498 NSValue *bi = (NSValue *)param; 503 NSValue *bi = (NSValue *)param;
499 DWBitBlt *bltinfo = (DWBitBlt *)[bi pointerValue]; 504 DWBitBlt *bltinfo = (DWBitBlt *)[bi pointerValue];
855 [DWApp setMainMenu:DWMainMenu]; 860 [DWApp setMainMenu:DWMainMenu];
856 } 861 }
857 _event_handler([self window], nil, 13); 862 _event_handler([self window], nil, 13);
858 } 863 }
859 -(void)setMenu:(NSMenu *)input { windowmenu = input; [windowmenu retain]; } 864 -(void)setMenu:(NSMenu *)input { windowmenu = input; [windowmenu retain]; }
860 -(void)menuHandler:(id)sender { _event_handler(sender, nil, 8); } 865 -(void)menuHandler:(id)sender { [DWObj performSelector:@selector(menuHandler:) withObject:sender afterDelay:0]; }
861 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } 866 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); }
862 -(void)mouseMoved:(NSEvent *)theEvent 867 -(void)mouseMoved:(NSEvent *)theEvent
863 { 868 {
864 id hit = [self hitTest:[theEvent locationInWindow]]; 869 id hit = [self hitTest:[theEvent locationInWindow]];
865 870