Blame SOURCES/dont-forward-keycode-0.patch

84159c
--- libX11-1.0.3/modules/im/ximcp/imDefLkup.c.dont-forward-keycode-0	2006-06-22 17:22:22.000000000 -0400
84159c
+++ libX11-1.0.3/modules/im/ximcp/imDefLkup.c	2006-09-20 17:57:49.000000000 -0400
84159c
@@ -332,6 +332,17 @@
84159c
     XEvent	*ev,
84159c
     Bool	 sync)
84159c
 {
84159c
+    /*
84159c
+     * Don't forward a key event which has keycode=0.
84159c
+     * keycode=0 is reserved for special purpose to let Xmb/wcLookupString()
84159c
+     * functions know that there is a commited string available from IM.
84159c
+     */
84159c
+    if (((ev->type == KeyPress) || (ev->type == KeyRelease))) {
84159c
+        if (((XKeyEvent *)ev)->keycode == 0) {
84159c
+            return True;
84159c
+        }
84159c
+    }
84159c
+
84159c
 #ifdef EXT_FORWARD
84159c
     if (((ev->type == KeyPress) || (ev->type == KeyRelease)))
84159c
 	if (_XimExtForwardKeyEvent(ic, (XKeyEvent *)ev, sync))
84159c
@@ -605,6 +616,19 @@
84159c
 	Xfree(info->keysym);
84159c
     ic->private.proto.commit_info = info->next;
84159c
     Xfree(info);
84159c
+
84159c
+    /*
84159c
+     * "Commit" uses fabricated flag to process a commited string
84159c
+     * from IM engine.  
84159c
+     * Turn off the fabricated flag here (unregister the commited
84159c
+     * information function). Otherwise, next regular key press
84159c
+     * event will be ignored at _XimProtoKeypressFilter() and it
84159c
+     * will not be passed to IM engine.
84159c
+     */
84159c
+    if (IS_FABRICATED(ic)) {
84159c
+        UNMARK_FABRICATED(ic);
84159c
+    }
84159c
+
84159c
     return;
84159c
 }
84159c
 
84159c
diff --git a/modules/im/ximcp/imDefFlt.c b/modules/im/ximcp/imDefFlt.c
84159c
index 1e4f389..09df352 100644
84159c
--- a/modules/im/ximcp/imDefFlt.c
84159c
+++ b/modules/im/ximcp/imDefFlt.c
84159c
@@ -142,7 +142,7 @@ _XimProtoKeypressFilter(
84159c
 {
84159c
     Xim		im = (Xim)ic->core.im;
84159c
 
84159c
-    if (IS_FABRICATED(im)) {
84159c
+    if ((ev->keycode == 0) || IS_FABRICATED(im)) {
84159c
 	_XimPendingFilter(ic);
84159c
 	UNMARK_FABRICATED(im);
84159c
 	return NOTFILTERD;