Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examine reported "surrounding texts" #425

Open
yan12125 opened this issue May 2, 2021 · 0 comments
Open

Examine reported "surrounding texts" #425

yan12125 opened this issue May 2, 2021 · 0 comments
Labels

Comments

@yan12125
Copy link
Member

yan12125 commented May 2, 2021

Expected Behavior

Good integration with system input methods

Current Behavior

Nobody knows how it works, and sometimes relevant code causes issues. In lxqt/qterminal#806 and lxqt/qterminal#820, it is discovered that incorrect computation in TerminalDisplay::inputMethodQuery() with Qt::ImSurroundingText causes crashes under Plasma wayland [1].

[1] https://github.com/lxqt/qtermwidget/blob/master/lib/TerminalDisplay.cpp#L2910

Possible Solution

Konsole has a relevant fix [2], while it still seems wrong as it returns the whole line for "surrounding texts". Needs to investigate what "surrounding texts" actually refer to.

Some specs

  • Wayland's text-input-unstable-v3 protocol [3]:

Text is UTF-8 encoded, and should include the cursor position, the complete selection and additional characters before and after them.

  • GtkIMContext in GTK+ [4]:

Retrieves context around the insertion point. Input methods typically want context in order to constrain input text based on existing text; this is important for languages such as Thai where only some sequences of characters are allowed.

[2] KDE/konsole@17cb78c
[3] https://github.com/wayland-project/wayland-protocols/blob/master/unstable/text-input/text-input-unstable-v3.xml
[4] https://developer.gnome.org/gtk3/stable/GtkIMContext.html#gtk-im-context-get-surrounding

Steps to Reproduce (for bugs)
  1. Create new tabs or split terminals using QTerminal under Plasma wayland
Context

Code arounding input method should really be understood and improved :)
Another long-standing issue about input methods - #127

System Information

(omitted as I cannot reproduce the bug itself. See issues linked above for reports from others)

@yan12125 yan12125 added the bug label May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant