diff options
author | marc_culler <marc.culler@gmail.com> | 2021-12-20 16:50:54 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2021-12-20 16:50:54 (GMT) |
commit | 774c6317321143cc524d608e9b78e8ee51cfb84e (patch) | |
tree | e9c429327a985bf2fa72c628a7581c400e13fa49 /macosx/tkMacOSXWm.c | |
parent | 32ad249136c01232bce166b33015f783f613bca2 (diff) | |
download | tk-774c6317321143cc524d608e9b78e8ee51cfb84e.zip tk-774c6317321143cc524d608e9b78e8ee51cfb84e.tar.gz tk-774c6317321143cc524d608e9b78e8ee51cfb84e.tar.bz2 |
Call TkUpdatePointer when a toplevel is destroyed.
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index be50f96..0d52e43 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1060,18 +1060,20 @@ TkWmDeadWindow( if (winPtr == [NSApp tkDragTarget]) { [NSApp setTkDragTarget:nil]; } - if (winPtr == [NSApp tkEventTarget]) { - [NSApp setTkEventTarget:nil]; - } if (winPtr == [NSApp tkPointerWindow]) { NSWindow *w; + NSPoint mouse = [NSEvent mouseLocation]; [NSApp setTkPointerWindow:nil]; for (w in [NSApp orderedWindows]) { if (w == deadNSWindow) { continue; } - if (NSPointInRect([NSEvent mouseLocation], [w frame])) { - [NSApp setTkPointerWindow:TkMacOSXGetTkWindow(w)]; + if (NSPointInRect(mouse, [w frame])) { + TkWindow *winPtr2 = TkMacOSXGetTkWindow(w); + int x = mouse.x, y = TkMacOSXZeroScreenHeight() - mouse.y; + [NSApp setTkPointerWindow:winPtr2]; + Tk_UpdatePointer((Tk_Window) winPtr2, x, y, + [NSApp tkButtonState]); break; } } |