diff options
author | fvogel <fvogelnew1@free.fr> | 2021-11-16 20:39:47 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2021-11-16 20:39:47 (GMT) |
commit | d8f50ac067d2f0df387ca0b0c46278c2464efc8b (patch) | |
tree | 4c40167ca8b673d38459b4478944b8bc60cc4a7f /macosx/tkMacOSXMouseEvent.c | |
parent | c56ea97892bf4b5716fd0c88709b0ef0cb130995 (diff) | |
parent | a9827f93eadc2978316098553e09406dae1f5520 (diff) | |
download | tk-bug-b1d115fa60.zip tk-bug-b1d115fa60.tar.gz tk-bug-b1d115fa60.tar.bz2 |
Merge 8.6bug-b1d115fa60
Diffstat (limited to 'macosx/tkMacOSXMouseEvent.c')
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 03d5730..2fcdeb9 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -114,6 +114,17 @@ enum { } case NSLeftMouseUp: case NSLeftMouseDown: + + /* + * Ignore mouse button events which arrive while the app is inactive. + * These events will be resent after activation, causing duplicate + * actions when an app is activated by a bound mouse event. See ticket + * [7bda9882cb]. + */ + + if (! [NSApp isActive]) { + return theEvent; + } case NSMouseMoved: case NSScrollWheel: #if 0 @@ -170,20 +181,18 @@ enum { */ capture = TkMacOSXGetCapture(); - if (capture) { + if (eventWindow) { + winPtr = TkMacOSXGetTkWindow(eventWindow); + } else if (capture) { winPtr = (TkWindow *) capture; eventWindow = TkMacOSXGetNSWindowForDrawable(winPtr->window); if (!eventWindow) { return theEvent; } - } else { - if (eventWindow) { - winPtr = TkMacOSXGetTkWindow(eventWindow); - } - if (!winPtr) { - eventWindow = [NSApp mainWindow]; - winPtr = TkMacOSXGetTkWindow(eventWindow); - } + } + if (!winPtr) { + eventWindow = [NSApp mainWindow]; + winPtr = TkMacOSXGetTkWindow(eventWindow); } if (!winPtr) { |