summaryrefslogtreecommitdiffstats
path: root/win/tkWinX.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-19 12:05:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-19 12:05:28 (GMT)
commit435849382625fcaae854915d50512dd1e6f27f2c (patch)
treecdabe9c60a5c8e415cbb4f7f05dd9b2b59372edf /win/tkWinX.c
parent71040c30eb391126e584a0acccd1562f9759d375 (diff)
parent26807808cc400ad9a0eab231cd691bd5d6722a76 (diff)
downloadtk-435849382625fcaae854915d50512dd1e6f27f2c.zip
tk-435849382625fcaae854915d50512dd1e6f27f2c.tar.gz
tk-435849382625fcaae854915d50512dd1e6f27f2c.tar.bz2
Enhanced proposed fix [6c0d7aec67]: unicode text input Windows 8. More places where Unicode surrogate handling could be improved.
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r--win/tkWinX.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c
index bb60a2d..987fbb5 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -1580,8 +1580,8 @@ HandleIMEComposition(
/*
* Set up the fields pertinent to key event.
*
- * We set send_event to the special value of -2, so that TkpGetString
- * in tkWinKey.c knows that trans_chars[] already contains a UNICODE
+ * We set send_event to the special value of -3, so that TkpGetString
+ * in tkWinKey.c knows that keycode already contains a UNICODE
* char and there's no need to do encoding conversion.
*
* Note that the event *must* be zeroed out first; Tk plays cunning
@@ -1592,7 +1592,7 @@ HandleIMEComposition(
memset(&event, 0, sizeof(XEvent));
event.xkey.serial = winPtr->display->request++;
- event.xkey.send_event = -2;
+ event.xkey.send_event = -3;
event.xkey.display = winPtr->display;
event.xkey.window = winPtr->window;
event.xkey.root = RootWindow(winPtr->display, winPtr->screenNum);
@@ -1600,8 +1600,7 @@ HandleIMEComposition(
event.xkey.state = TkWinGetModifierState();
event.xkey.time = TkpGetMS();
event.xkey.same_screen = True;
- event.xkey.keycode = 0;
- event.xkey.nbytes = 2;
+ event.xkey.nbytes = 0;
for (i=0; i<n; ) {
/*
@@ -1609,8 +1608,8 @@ HandleIMEComposition(
* UNICODE character in the composition.
*/
- event.xkey.trans_chars[0] = (char) buff[i++];
- event.xkey.trans_chars[1] = (char) buff[i++];
+ event.xkey.keycode = ((unsigned char) buff[i++]) << 8;
+ event.xkey.keycode += (unsigned char) buff[i++];
event.type = KeyPress;
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);