958512
diff -up libX11-1.6.3/modules/im/ximcp/imDefFlt.c.jx libX11-1.6.3/modules/im/ximcp/imDefFlt.c
958512
--- libX11-1.6.3/modules/im/ximcp/imDefFlt.c.jx	2015-03-09 18:28:45.000000000 -0400
958512
+++ libX11-1.6.3/modules/im/ximcp/imDefFlt.c	2015-03-10 12:32:31.912149644 -0400
958512
@@ -142,7 +142,7 @@ _XimProtoKeypressFilter(
958512
 {
958512
     Xim		im = (Xim)ic->core.im;
958512
 
958512
-    if (IS_FABRICATED(im)) {
958512
+    if ((ev->keycode == 0) || IS_FABRICATED(im)) {
958512
 	_XimPendingFilter(ic);
958512
 	UNMARK_FABRICATED(im);
958512
 	return NOTFILTERD;
958512
diff -up libX11-1.6.3/modules/im/ximcp/imDefLkup.c.jx libX11-1.6.3/modules/im/ximcp/imDefLkup.c
958512
--- libX11-1.6.3/modules/im/ximcp/imDefLkup.c.jx	2015-03-09 18:28:45.000000000 -0400
958512
+++ libX11-1.6.3/modules/im/ximcp/imDefLkup.c	2015-03-10 12:32:31.911149637 -0400
958512
@@ -332,6 +332,17 @@ _XimForwardEvent(
958512
     XEvent	*ev,
958512
     Bool	 sync)
958512
 {
958512
+    /*
958512
+     * Don't forward a key event which has keycode=0.
958512
+     * keycode=0 is reserved for special purpose to let Xmb/wcLookupString()
958512
+     * functions know that there is a commited string available from IM.
958512
+     */
958512
+    if (((ev->type == KeyPress) || (ev->type == KeyRelease))) {
958512
+        if (((XKeyEvent *)ev)->keycode == 0) {
958512
+            return True;
958512
+        }
958512
+    }
958512
+
958512
 #ifdef EXT_FORWARD
958512
     if (((ev->type == KeyPress) || (ev->type == KeyRelease)))
958512
 	if (_XimExtForwardKeyEvent(ic, (XKeyEvent *)ev, sync))
958512
@@ -604,6 +615,19 @@ _XimUnregCommitInfo(
958512
     Xfree(info->keysym);
958512
     ic->private.proto.commit_info = info->next;
958512
     Xfree(info);
958512
+
958512
+    /*
958512
+     * "Commit" uses fabricated flag to process a commited string
958512
+     * from IM engine.  
958512
+     * Turn off the fabricated flag here (unregister the commited
958512
+     * information function). Otherwise, next regular key press
958512
+     * event will be ignored at _XimProtoKeypressFilter() and it
958512
+     * will not be passed to IM engine.
958512
+     */
958512
+    if (IS_FABRICATED(ic)) {
958512
+        UNMARK_FABRICATED(ic);
958512
+    }
958512
+
958512
     return;
958512
 }
958512