Bug: Typing "àãáâ" in Anki inserts "aaaa" in text fields (only when using Wayland)

Copying and pasting the characters works as expected.
Works fine when using X11 too.

Anki 2.1.49 (dc80804a) Python 3.8.1 Qt 5.15.1 PyQt 5.15.1
Platform: Linux
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2021-11-16 14:41:01

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

===IDs of active AnkiWeb add-ons===

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Add note id ['1672832404', 2020-12-06T07:44, 'None', '']
Batch Editing ['291119185', 2020-01-14T10:41, 'None', '']
Button Colours Good Again ['2494384865', 2021-04-06T11:57, 'None', '']
Enhance main window ['877182321', 2020-12-23T01:42, 'None', '']
Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-27T23:21, 'None', '']
LPCG LyricsPoetry Cloze Generator ['2084557901', 2021-07-24T19:17, 'None', '']
Life Drain ['715575551', 2021-11-04T11:31, 'None', '']
Replay buttons on card ['498789867', 2019-03-03T15:12, 'None', '']
Review Heatmap ['review_heatmap', 2020-04-30T10:23, 'None', '']
Spelling Police ['1410276506', 2020-04-30T01:25, 'None', '']
Syntax Highlighting for Code ['1463041493', 2018-10-06T22:31, 'None', mod]
True Retention ['613684242', 2019-03-03T15:13, 'None', '']

What is your input method? I can type any of these without problems in Anki under wayland (I use swaywm), typing these accented letters both with native layout (ie. à) and with the compose key (ie Compose+a+ produces á).
Besides that, does typing these characters works outside of Anki? Have you tried disabling all add-ons? Have you tried running the Qt-6 build?

1 Like

I am not sure what you mean. If you mean the input method my wayland installation is using, I don’t know (I am using KDE’s default kwin as my wayland compositor, don’t know if that helps).

If you mean how I am introducing these characters, I am just typing them normally on a physical keyboard.

Yes. Just having problems with Anki.

“á” with native layout:
Anki: a
Other: á
“á” with compose key:
Anki: a’ (chars start showing right after pressing the “a” key)
Other: á (char just shows after hole sequence is introduced)

Yes. The problem persists.

Not yet. I can try. First, I will try changing my wayland compositor to swaywm to see what happens.

Also, there is a bug that I have noted (I don’t know if it’s related) with Anki under Wayland, it’s that when there is an entry widget, it does not get the focus by default, but when you type, it still works. However, when in this strange mode (where the entry is not focused, but still receiving the input), the compose key does not work.
The behavior corresponds to the one described by you when using the compose key.
This is solved by focusing the entry, by clicking on it for example. Does focusing the entry work for you?

No. It doesn’t.

I installed another wayland compositor (mutter), and Anki now works fine.

I Just tried to run the Qt-6 build (anki-2.1.50-linux-x86_64-qt6). Also works for me.

So the problem seems to occur only with Anki+Qt5 under a plasma/wayland session on linux.

Does this bug report look similar to your bug?
The discussion is quite long, but you can find some possible workarounds, including setting QT_IM_MODULE=.

1 Like

That is exactly it!

If I launch Anki from my terminal with:

env QT_IM_MODULE= anki

(env is a archlinux utility that can be used to run a command under a modified environment)

The problem doesn’t occur.

But if I just launch it normally with:


The problem “comes back”.

Extrangely enough, this bug seems already solved, but, if you change your keyboard to Brazilian Portuguese, as it is my case, he seems to resurface. Another strange thing is that it only affects some applications. In my case it was just Anki.

Anyway, thank you for finding and sharing this.