diff options
author | wordtech <wordtech@noemail.net> | 2011-01-24 15:20:50 (GMT) |
---|---|---|
committer | wordtech <wordtech@noemail.net> | 2011-01-24 15:20:50 (GMT) |
commit | c61c1fa729d34da927ab65b88979b07edbfc603b (patch) | |
tree | 8872c7a6d619fa0eb5c2e37f6c143334b98cb283 /macosx/tkMacOSXKeyEvent.c | |
parent | 49e38805fd25ff3d3c8cd9796bbb54f40a3a51a5 (diff) | |
download | tk-c61c1fa729d34da927ab65b88979b07edbfc603b.zip tk-c61c1fa729d34da927ab65b88979b07edbfc603b.tar.gz tk-c61c1fa729d34da927ab65b88979b07edbfc603b.tar.bz2 |
Fix for SF bug 2907388 (crash on composite characters)
FossilOrigin-Name: 9b0938d28a5047a9856230377548cd1450168bb9
Diffstat (limited to 'macosx/tkMacOSXKeyEvent.c')
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 8d85629..051f291 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.30 2010/01/06 14:27:33 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.31 2011/01/24 15:20:50 wordtech Exp $ */ #include "tkMacOSXPrivate.h" @@ -147,6 +147,9 @@ static NSModalSession modalSession = NULL; } else { xEvent.xany.type = KeyPress; } + +/* prevent SF bug 2907388 here (crash on composite characters) */ +if ([characters length] > 0) { xEvent.xkey.keycode = (keyCode << 16) | (UInt16) [characters characterAtIndex:0]; if (![characters getCString:xEvent.xkey.trans_chars @@ -154,6 +157,9 @@ static NSModalSession modalSession = NULL; TkMacOSXDbgMsg("characters too long"); return theEvent; } +} +/* end workaround */ + len = [charactersIgnoringModifiers length]; if (len) { xEvent.xkey.nbytes = [charactersIgnoringModifiers characterAtIndex:0]; |