diff options
author | wordtech <wordtech> | 2011-01-24 15:20:50 (GMT) |
---|---|---|
committer | wordtech <wordtech> | 2011-01-24 15:20:50 (GMT) |
commit | 65664f23690aae1f0085eaf6a6315b3f4b70b5b5 (patch) | |
tree | 8872c7a6d619fa0eb5c2e37f6c143334b98cb283 | |
parent | e25ac70807eb35adb89ec43c94553588d4327fb3 (diff) | |
download | tk-65664f23690aae1f0085eaf6a6315b3f4b70b5b5.zip tk-65664f23690aae1f0085eaf6a6315b3f4b70b5b5.tar.gz tk-65664f23690aae1f0085eaf6a6315b3f4b70b5b5.tar.bz2 |
Fix for SF bug 2907388 (crash on composite characters)
-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]; |