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