fltk-rs: [BUG] IME problem under wayland

Describe the bug

When I input ASCII characters, as long as the frequency is a little faster, repeated characters will appear. For example, “hello world” will become: “heeellllllooo wwooorrrlld”.

When I input Unicode characters, there is a high probability that the characters will be garbled, and sometimes the input characters will disappear.

The most outrageous thing is that sometimes it triggers the string to “flicker”.

https://github.com/fltk-rs/fltk-rs/assets/25324935/b70e5e3b-ca7f-422f-a3d8-195caa1f9f0a

In the video above, it looks like I’m constantly deleting text, but I’m not. I just typed emo.

image

Note: Only wayland triggers this issue, x11 does not.

This issue has rendered the input method of Wayland basically unusable, I hope it can be fixed.

To Reproduce

Cargo.toml

[dependencies]
fltk = { version = "1.4.28", features = [
    "use-ninja",
    "use-wayland",
] }

src: https://github.com/fltk-rs/fltk-rs/blob/682a7255df5a887412f5c3f2c228f133a602af74/fltk/examples/editor.rs

Expected behavior

Perfect support for Wayland.

Desktop info

  • OS: Debian Sid GNU/Linux (x86_64)
  • Version: 1.4.28
  • Display: Wayland
  • Desktop: KDE Plasma 5.27.10-1+b2

Additional info

(process:160445): Pango-WARNING **: 22:53:29.310: Invalid UTF-8 string passed to pango_layout_set_text()

About this issue

  • Original URL
  • State: closed
  • Created 2 months ago
  • Comments: 39

Commits related to this issue

Most upvoted comments

Here, I find the fcitx5 IM mostly works and I obtain this image after 2 rounds of IM.

Capture with the auxiliary window at work: image

The only problem I see is that entered text is selected so I have to type the right arrow key after.

I am puzzled.

The "selected’ is just a preedit style passed from input method, not really “selected”.

@2moe I think the useful information here is to run WAYLAND_DEBUG=1 with fltk app.

It’s 8pm here, so I’m stopping for today. Good evening.

@2moe I would need some more info, please, to try and reproduce the issue.

  • do you use an input method, such as one to input Chinese or Japanese characters?
  • if yes, do you activate this input method via a menu on the desktop such as this one:

InputMethodsMenu

  • what do you mean by “input Unicode characters” ?
  • is the issue that fast typing tends to create repeated characters related or not to the issue about “garbled characters” ?