summaryrefslogtreecommitdiff
path: root/dont-forward-keycode-0.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-06 02:19:21 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-06 02:19:21 +0000
commit17835c5af459d8f2a2cd7e6429073ae106d8b918 (patch)
treeaa0eb02acde1e7773dba0e9714ed6f0c3bf9dd1c /dont-forward-keycode-0.patch
parent38b1e7abff8deff663879e1b2800b953c7c09316 (diff)
automatic import of libX11openeuler24.03_LTS
Diffstat (limited to 'dont-forward-keycode-0.patch')
-rw-r--r--dont-forward-keycode-0.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/dont-forward-keycode-0.patch b/dont-forward-keycode-0.patch
new file mode 100644
index 0000000..c16d874
--- /dev/null
+++ b/dont-forward-keycode-0.patch
@@ -0,0 +1,53 @@
+diff -up libX11-1.6.3/modules/im/ximcp/imDefFlt.c.jx libX11-1.6.3/modules/im/ximcp/imDefFlt.c
+--- libX11-1.6.3/modules/im/ximcp/imDefFlt.c.jx 2015-03-09 18:28:45.000000000 -0400
++++ libX11-1.6.3/modules/im/ximcp/imDefFlt.c 2015-03-10 12:32:31.912149644 -0400
+@@ -142,7 +142,7 @@ _XimProtoKeypressFilter(
+ {
+ Xim im = (Xim)ic->core.im;
+
+- if (IS_FABRICATED(im)) {
++ if ((ev->keycode == 0) || IS_FABRICATED(im)) {
+ _XimPendingFilter(ic);
+ UNMARK_FABRICATED(im);
+ return NOTFILTERD;
+diff -up libX11-1.6.3/modules/im/ximcp/imDefLkup.c.jx libX11-1.6.3/modules/im/ximcp/imDefLkup.c
+--- libX11-1.6.3/modules/im/ximcp/imDefLkup.c.jx 2015-03-09 18:28:45.000000000 -0400
++++ libX11-1.6.3/modules/im/ximcp/imDefLkup.c 2015-03-10 12:32:31.911149637 -0400
+@@ -332,6 +332,17 @@ _XimForwardEvent(
+ 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))
+@@ -604,6 +615,19 @@ _XimUnregCommitInfo(
+ 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_FABRICATED(ic)) {
++ UNMARK_FABRICATED(ic);
++ }
++
+ return;
+ }
+