示例#1
0
文件: ui.c 项目: hiroshiyui/fcitx
FCITX_EXPORT_API
void FcitxUIOnTriggerOn(FcitxInstance* instance)
{
    if (UI_FUNC_IS_VALID(OnTriggerOn))
        instance->ui->ui->OnTriggerOn(instance->ui->addonInstance);

    FcitxInstanceProcessTriggerOnHook(instance);

    instance->timeStart = time(NULL);

    FcitxInstanceShowInputSpeed(instance);
}
示例#2
0
文件: ui.c 项目: hiroshiyui/fcitx
FCITX_EXPORT_API
void FcitxUIOnInputFocus(FcitxInstance* instance)
{
    if (UI_FUNC_IS_VALID(OnInputFocus))
        instance->ui->ui->OnInputFocus(instance->ui->addonInstance);

    FcitxInstanceProcessInputFocusHook(instance);

    FcitxInstanceResetInput(instance);

    boolean changed = FcitxInstanceUpdateCurrentIM(instance, false);

    if (instance->config->bShowInputWindowWhenFocusIn && changed)
        FcitxInstanceShowInputSpeed(instance);
    else
        FcitxUICloseInputWindow(instance);
}
示例#3
0
文件: ui.c 项目: 13572293130/fcitx
FCITX_EXPORT_API
void FcitxUIOnInputFocus(FcitxInstance* instance)
{
    if (UI_FUNC_IS_VALID(OnInputFocus))
        instance->ui->ui->OnInputFocus(instance->ui->addonInstance);

    FcitxInstanceProcessInputFocusHook(instance);

    FcitxInstanceResetInput(instance);

    boolean changed;

    if (instance->lastIC == instance->CurrentIC && instance->delayedIM) {
        FcitxInstanceSwitchIMByName(instance, instance->delayedIM);
        changed = true;
    } else {
        changed = FcitxInstanceUpdateCurrentIM(instance, false, false);
    }

    if (instance->config->bShowInputWindowWhenFocusIn && changed)
        FcitxInstanceShowInputSpeed(instance);
    else
        FcitxUICloseInputWindow(instance);
}