changeset 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 b6249d66404c
children e79cf0d73caf
files mac/dw.m
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Wed Nov 23 00:49:12 2011 +0000
+++ b/mac/dw.m	Wed Nov 23 20:00:17 2011 +0000
@@ -480,6 +480,7 @@
 @interface DWObject : NSObject {}
 -(void)uselessThread:(id)sender;
 -(void)synchronizeThread:(id)param;
+-(void)menuHandler:(id)param;
 -(void)doBitBlt:(id)param;
 -(void)doFlush:(id)param;
 @end
@@ -493,6 +494,10 @@
     pthread_mutex_unlock(DWThreadMutex2);
     pthread_mutex_lock(DWRunMutex);
 }
+-(void)menuHandler:(id)param
+{
+    _event_handler(param, nil, 8);
+}
 -(void)doBitBlt:(id)param
 {
     NSValue *bi = (NSValue *)param;
@@ -857,7 +862,7 @@
     _event_handler([self window], nil, 13);
 }
 -(void)setMenu:(NSMenu *)input { windowmenu = input; [windowmenu retain]; }
--(void)menuHandler:(id)sender { _event_handler(sender, nil, 8); }
+-(void)menuHandler:(id)sender { [DWObj performSelector:@selector(menuHandler:) withObject:sender afterDelay:0]; }
 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); }
 -(void)mouseMoved:(NSEvent *)theEvent
 {