summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXKeyEvent.c
diff options
context:
space:
mode:
authorculler <culler>2021-05-06 14:18:18 (GMT)
committerculler <culler>2021-05-06 14:18:18 (GMT)
commit1db0bf3fc72cd67217b6173d6e269f97c032b2f8 (patch)
tree846687368269536d3f83b689ef7fe4421e29e396 /macosx/tkMacOSXKeyEvent.c
parente90c3f6d3a2bec9a074ebbbac695bda5557c6df5 (diff)
downloadtk-1db0bf3fc72cd67217b6173d6e269f97c032b2f8.zip
tk-1db0bf3fc72cd67217b6173d6e269f97c032b2f8.tar.gz
tk-1db0bf3fc72cd67217b6173d6e269f97c032b2f8.tar.bz2
Try to fix [171ba701e5]: crash when key is pressed after grab window loses focus.
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r--macosx/tkMacOSXKeyEvent.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 2452c1d..07f7107 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -94,7 +94,10 @@ static NSUInteger textInputModifiers;
if (grabWinPtr) {
if (winPtr->dispPtr->grabFlags || /* global grab */
grabWinPtr->mainPtr == winPtr->mainPtr){ /* same application */
- winPtr =winPtr->dispPtr->focusPtr;
+ winPtr = winPtr->dispPtr->focusPtr;
+ if (!winPtr) {
+ return theEvent;
+ }
tkwin = (Tk_Window)winPtr;
}
}