Example #1
0
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);
}
Example #2
0
File: ui.c Project: pkg-ime/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);
    if (instance->config->firstAsInactive) {
        if (FcitxInstanceGetCurrentState(instance) == IS_ACTIVE)
            FcitxInstanceSwitchIM(instance, instance->lastIMIndex);
        else if (FcitxInstanceGetCurrentState(instance) == IS_ENG) {
            if (instance->iIMIndex != 0)
                instance->lastIMIndex = instance->iIMIndex;
            FcitxInstanceSwitchIMInternal(instance, 0, false);
        }
    }

    FcitxUICloseInputWindow(instance);
}
Example #3
0
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);
}