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