summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2021-10-30 02:05:18 (GMT)
committermarc_culler <marc.culler@gmail.com>2021-10-30 02:05:18 (GMT)
commitae9ec0f179b4d64a2fc92134c8d909c628e5a86d (patch)
tree83bc321122aee1750bb707cd6637755ce22cea37
parent9f8d0084fff43896df80b3c6eeca47c145bcd940 (diff)
parent5a6f441daebedd058b63c84d352565d8c5d2988a (diff)
downloadtk-ae9ec0f179b4d64a2fc92134c8d909c628e5a86d.zip
tk-ae9ec0f179b4d64a2fc92134c8d909c628e5a86d.tar.gz
tk-ae9ec0f179b4d64a2fc92134c8d909c628e5a86d.tar.bz2
Fix [6ea0b3df60]: MacOS - grab from menu command produces dead window
-rw-r--r--macosx/tkMacOSXMouseEvent.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 43babbc..2fcdeb9 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -181,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) {