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