diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-03-21 00:57:31 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-03-21 00:57:31 (GMT) |
commit | f22c4207e5275f1e2c792672b41f6828372d6203 (patch) | |
tree | b059e6ed5fc502b421bbe15198bc90824dfba74f /macosx/tkMacOSXMouseEvent.c | |
parent | 9787a9f42d575fd80d370323e6fe37290f5609cd (diff) | |
download | tk-f22c4207e5275f1e2c792672b41f6828372d6203.zip tk-f22c4207e5275f1e2c792672b41f6828372d6203.tar.gz tk-f22c4207e5275f1e2c792672b41f6828372d6203.tar.bz2 |
Cleanup and improvement of tracking of native windows in Cocoa; thanks to Marc Culler for patch
Diffstat (limited to 'macosx/tkMacOSXMouseEvent.c')
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 89f0642..d1b4114 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -52,19 +52,17 @@ enum { case NSCursorUpdate: #if 0 trackingArea = [theEvent trackingArea]; -#endif /* fall through */ +#endif case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: case NSRightMouseUp: case NSOtherMouseDown: case NSOtherMouseUp: - case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged: - case NSMouseMoved: #if 0 eventNumber = [theEvent eventNumber]; @@ -73,19 +71,17 @@ enum { buttonNumber = [theEvent buttonNumber]; } #endif - case NSTabletPoint: case NSTabletProximity: - case NSScrollWheel: - win = [self windowWithWindowNumber:[theEvent windowNumber]]; break; - default: + default: /* Unrecognized mouse event. */ return theEvent; - break; } + /* Create an Xevent to add to the Tk queue. */ + win = [theEvent window]; NSPoint global, local = [theEvent locationInWindow]; if (win) { global = [win convertBaseToScreen:local]; @@ -103,7 +99,7 @@ enum { tkwin = TkMacOSXGetCapture(); } if (!tkwin) { - return theEvent; + return theEvent; /* Give up. No window for this event. */ } /* @@ -203,7 +199,6 @@ enum { Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); } } - return theEvent; } @end |