Add patch to not forward keycode 0

This commit is contained in:
sandmann 2006-09-20 22:12:57 +00:00
parent 0d6610bbf2
commit 0df6210d9c
2 changed files with 57 additions and 1 deletions

View File

@ -0,0 +1,51 @@
--- 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;
}
--- libX11-1.0.3/modules/im/ximcp/imDefFlt.c.dont-forward-keycode-0 2006-06-22 17:22:22.000000000 -0400
+++ libX11-1.0.3/modules/im/ximcp/imDefFlt.c 2006-09-20 17:57:49.000000000 -0400
@@ -147,7 +147,7 @@
Xim im = (Xim)ic->core.im;
#endif
- if (IS_FABLICATED(ic)) {
+ if ((ev->keycode == 0) || IS_FABLICATED(ic)) {
_XimPendingFilter(ic);
UNMARK_FABLICATED(ic);
return NOTFILTERD;

View File

@ -1,7 +1,7 @@
Summary: X.Org X11 libX11 runtime library
Name: libX11
Version: 1.0.3
Release: 2%{?dist}
Release: 3%{?dist}
License: MIT/X11
Group: System Environment/Libraries
URL: http://www.x.org
@ -14,6 +14,7 @@ Patch0: libX11-0.99.3-datadir-locale-dir-fix.patch
# this patch is now committed upstream. When libX11-1.0.4 is released,
# manually confirm each patch hunk before removal.
Patch1: libX11-nls-indic-locales-bug185376.patch
Patch2: dont-forward-keycode-0.patch
BuildRequires: pkgconfig
# xproto >= 7.0.6 required
@ -52,6 +53,7 @@ X.Org X11 libX11 development package
# find it later.
#%patch0 -p0 -b .datadir-locale-dir-fix
%patch1 -p0 -b .nls-indic-locales-bug185376
%patch2 -p1 -b .dont-forward-keycode-0
# Disable static library creation by default.
%define with_static 0
@ -244,6 +246,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/*.3x*
%changelog
* Wed Sep 20 2006 Soren Sandmann <sandmann@redhat.com> 1.0.3-3.fc6
- Add patch to not forward keycode 0 (#194357).
* Wed Jul 19 2006 Mike A. Harris <mharris@redhat.com> 1.0.3-2.fc6
- Added libX11-nls-indic-locales-bug185376.patch to add support for various
indic locales which have now been committed upstream (#185376)