Projects
openEuler:24.03:SP1:Everything:64G
libX11
_service:tar_scm:dont-forward-keycode-0.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:dont-forward-keycode-0.patch of Package libX11
From f8b0946c5594728ce7e1cd04552acce05571cd4e Mon Sep 17 00:00:00 2001 From: leeffo <leeffo@yeah.net> Date: Wed, 12 Apr 2023 10:40:48 +0800 Subject: [PATCH] dont forward keycode 0 --- modules/im/ximcp/imDefFlt.c | 2 +- modules/im/ximcp/imDefLkup.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/modules/im/ximcp/imDefFlt.c b/modules/im/ximcp/imDefFlt.c index 44cc688..f89d2cb 100644 --- a/modules/im/ximcp/imDefFlt.c +++ b/modules/im/ximcp/imDefFlt.c @@ -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 --git a/modules/im/ximcp/imDefLkup.c b/modules/im/ximcp/imDefLkup.c index dd1adf5..61f9c95 100644 --- a/modules/im/ximcp/imDefLkup.c +++ b/modules/im/ximcp/imDefLkup.c @@ -333,6 +333,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)) @@ -605,6 +616,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; } -- 2.20.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2