Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Typing quickly causes characters to be inputted out of order #5

Closed
lliehu opened this issue Jan 18, 2015 · 2 comments
Closed

Typing quickly causes characters to be inputted out of order #5

lliehu opened this issue Jan 18, 2015 · 2 comments

Comments

@lliehu
Copy link

lliehu commented Jan 18, 2015

Sometimes if one types quickly, characters will be inputted in wrong order. For example if one types "something", the result in a text field can be for example "something", "gnihtemos", "somethgni", "sometgnih" or "somegniht".

There might be a pattern that some character sequences are inputted in reverse order.

I can reproduce this every time with a simple test case that consists only of a QLineEdit. This issue only occurs when using fcitx-qt5, so I think it's quite likely that the problem is in fcitx-qt5. I also tested with ibus and without any im module. There were no problems.

I also tested this by using a program to input "something" character and character, thus eliminating the possibility of a human making typos.

This is the test case (compile with -std=c++11):

#include <QApplication>
#include <QLineEdit>
#include <QThread>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QLineEdit textField;
    // Sleep for one second each time text is changed.
    // This is to make it easier to reproduce the issue.
    QObject::connect(&textField, &QLineEdit::textChanged, [](){
        QThread::sleep(1);
    });
    textField.show();

    return a.exec();
}
wengxt added a commit that referenced this issue Jan 18, 2015
Nested event loop seems to be the root cause for this.
@wengxt wengxt closed this as completed Jan 18, 2015
@lliehu
Copy link
Author

lliehu commented Jan 18, 2015

Thanks. Launching applications with KDE Plasma 5's Krunner is now a lot easier.

@insulsa
Copy link

insulsa commented Dec 20, 2019

Excuse me for this being irrelevant, but I'm using fcitx 4.2.9.6 shipped with ubuntu, the xkb input method, and the XIM frontend. When the operating system is under high load, fcitx dumps characters out of order significantly. Sometimes I had to pause typing for more than 1 second for each character to appear on screen. It becomes worse when using the libpinyin input method. This also happens with fcitx 4.2.9.7 shipped with debian, and another install I don't recall the version, and on different physical hardware. Any hint for what I could do to diagnose this?

wengxt added a commit that referenced this issue Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants