diff options
author | culler <culler> | 2021-05-06 14:18:18 (GMT) |
---|---|---|
committer | culler <culler> | 2021-05-06 14:18:18 (GMT) |
commit | 1db0bf3fc72cd67217b6173d6e269f97c032b2f8 (patch) | |
tree | 846687368269536d3f83b689ef7fe4421e29e396 /macosx/tkMacOSXKeyEvent.c | |
parent | e90c3f6d3a2bec9a074ebbbac695bda5557c6df5 (diff) | |
download | tk-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.c | 5 |
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; } } |