forked from pool/fcitx
Accepting request 230842 from M17N
revert (forwarded request 230841 from MargueriteSu) OBS-URL: https://build.opensuse.org/request/show/230842 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fcitx?expand=0&rev=35
This commit is contained in:
commit
cf901ea8c4
59
fcitx-context-variable-disable-punc-on-the-fly.patch
Normal file
59
fcitx-context-variable-disable-punc-on-the-fly.patch
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
From: Xuetian Weng <wengxt@gmail.com>
|
||||||
|
Date: Tue, 11 Mar 2014 00:13:43 +0800
|
||||||
|
Subject: add a context variable to disable punc
|
||||||
|
|
||||||
|
---
|
||||||
|
src/lib/fcitx/context.h | 2 ++
|
||||||
|
src/module/punc/punc.c | 12 ++++++++++++
|
||||||
|
2 files changed, 14 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/lib/fcitx/context.h b/src/lib/fcitx/context.h
|
||||||
|
index 32115af..05f0f91 100644
|
||||||
|
--- a/src/lib/fcitx/context.h
|
||||||
|
+++ b/src/lib/fcitx/context.h
|
||||||
|
@@ -70,6 +70,8 @@ extern "C" {
|
||||||
|
#define CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT "CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT"
|
||||||
|
/** disable auto first candidate highlight */
|
||||||
|
#define CONTEXT_DISABLE_FULLWIDTH "CONTEXT_DISABLE_FULLWIDTH"
|
||||||
|
+ /** disable punc module */
|
||||||
|
+ #define CONTEXT_DISABLE_PUNC "CONTEXT_DISABLE_PUNC"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief register a new global context variable
|
||||||
|
diff --git a/src/module/punc/punc.c b/src/module/punc/punc.c
|
||||||
|
index be6dec3..3327f9c 100644
|
||||||
|
--- a/src/module/punc/punc.c
|
||||||
|
+++ b/src/module/punc/punc.c
|
||||||
|
@@ -154,6 +154,8 @@ void* PuncCreate(FcitxInstance* instance)
|
||||||
|
PuncWhichCopy, PuncWhichFree,
|
||||||
|
puncState);
|
||||||
|
|
||||||
|
+ FcitxInstanceRegisterWatchableContext(instance, CONTEXT_DISABLE_PUNC, FCT_Boolean, FCF_ResetOnInputMethodChange);
|
||||||
|
+
|
||||||
|
FcitxPuncAddFunctions(instance);
|
||||||
|
return puncState;
|
||||||
|
}
|
||||||
|
@@ -250,6 +252,11 @@ boolean PuncPreFilter(void* arg, FcitxKeySym sym, unsigned int state,
|
||||||
|
{
|
||||||
|
FCITX_UNUSED(retVal);
|
||||||
|
FcitxPuncState *puncState = (FcitxPuncState*)arg;
|
||||||
|
+ boolean disablePunc = FcitxInstanceGetContextBoolean(
|
||||||
|
+ puncState->owner, CONTEXT_DISABLE_PUNC);
|
||||||
|
+ if (disablePunc)
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
if (FcitxHotkeyIsHotKeySimple(sym, state) &&
|
||||||
|
!FcitxHotkeyIsHotKeyDigit(sym, state) && !IsHotKeyPunc(sym, state))
|
||||||
|
puncState->bLastIsNumber = false;
|
||||||
|
@@ -269,6 +276,11 @@ boolean ProcessPunc(void* arg, FcitxKeySym sym, unsigned int state, INPUT_RETURN
|
||||||
|
if (*retVal != IRV_TO_PROCESS)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
+ boolean disablePunc = FcitxInstanceGetContextBoolean(
|
||||||
|
+ puncState->owner, CONTEXT_DISABLE_PUNC);
|
||||||
|
+ if (disablePunc)
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
FcitxCandidateWordList *candList = FcitxInputStateGetCandidateList(input);
|
||||||
|
if (FcitxCandidateWordGetListSize(candList) != 0) {
|
||||||
|
if (FcitxCandidateWordGetHasGoneToNextPage(candList) &&
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 17 16:10:11 UTC 2014 - i@marguerite.su
|
||||||
|
|
||||||
|
- add patch: fcitx-context-variable-disable-punc-on-the-fly.patch
|
||||||
|
* To support the recently released Sogou Pinyin, we need this
|
||||||
|
patch to allow Sogou to disable punc on the fly.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Feb 14 13:07:53 UTC 2014 - fcrozat@suse.com
|
Fri Feb 14 13:07:53 UTC 2014 - fcrozat@suse.com
|
||||||
|
|
||||||
|
@ -34,6 +34,9 @@ Source7: xinput-fcitx
|
|||||||
Source8: openSUSE-default.tar.gz
|
Source8: openSUSE-default.tar.gz
|
||||||
Source9: macros.%{name}
|
Source9: macros.%{name}
|
||||||
BuildRequires: cairo-devel
|
BuildRequires: cairo-devel
|
||||||
|
#PATCH-FEATURE-OPENSUSE marguerite@opensuse.org To support sougou IM, we need a context
|
||||||
|
# variable to disable punc on the fly
|
||||||
|
Patch: fcitx-context-variable-disable-punc-on-the-fly.patch
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
BuildRequires: dbus-1-devel
|
BuildRequires: dbus-1-devel
|
||||||
BuildRequires: dbus-1-glib-devel
|
BuildRequires: dbus-1-glib-devel
|
||||||
@ -368,6 +371,7 @@ You can either use this package for download from kde-look.org using knewstaff i
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%setup -q -n %{name}-%{version}
|
||||||
|
%patch -p1
|
||||||
# hack to fix incompatibility of gtk-query-immodules-2.0 (bnc#845860)
|
# hack to fix incompatibility of gtk-query-immodules-2.0 (bnc#845860)
|
||||||
%if %suse_version < 1310
|
%if %suse_version < 1310
|
||||||
sed -i \
|
sed -i \
|
||||||
|
Loading…
Reference in New Issue
Block a user