summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorculler <culler>2024-05-28 03:35:38 (GMT)
committerculler <culler>2024-05-28 03:35:38 (GMT)
commitd0863507871c8c40fefb431343082e2607e2f583 (patch)
treef95f75c72546a5439a1151ee6d407baf13786356 /macosx
parentd2d0cce3dd0d647a9744613bff159313ff486260 (diff)
downloadtk-d0863507871c8c40fefb431343082e2607e2f583.zip
tk-d0863507871c8c40fefb431343082e2607e2f583.tar.gz
tk-d0863507871c8c40fefb431343082e2607e2f583.tar.bz2
Avoid calling TkUpdatePointer for a window which is being destroyed by a child's <Destroy> binding script.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXWm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 96478f4..d5575cc 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -1027,8 +1027,11 @@ TkWmDeadWindow(
root_y = floor(TkMacOSXZeroScreenHeight() - mouse.y);
int win_x, win_y;
Tk_Window target = Tk_TopCoordsToWindow((Tk_Window) winPtr2, top_x, top_y, &win_x, &win_y);
- if (target != (Tk_Window) winPtr) {
- Tk_UpdatePointer((Tk_Window) target, root_x, root_y, [NSApp tkButtonState]);
+ /* A non-toplevel window can have a NULL parent while it is in the process of
+ * being destroyed. We should not call Tk_UpdatePointer in that case.
+ */
+ if (Tk_Parent(target) != NULL || Tk_IsTopLevel(target)) {
+ Tk_UpdatePointer(target, root_x, root_y, [NSApp tkButtonState]);
}
}