Bug 433576 - keyboard configurations with single layout are broken on Wayland
Summary: keyboard configurations with single layout are broken on Wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.21.2
Platform: Compiled Sources Linux
: VHI normal
Target Milestone: ---
Assignee: Andrey
URL:
Keywords: regression, wayland
: 432438 433301 435002 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-25 10:58 UTC by geisserml
Modified: 2021-12-17 14:11 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21.4


Attachments
kxkbrc (309 bytes, text/plain)
2021-03-05 16:49 UTC, geisserml
Details

Note You need to log in before you can comment on or make changes to this bug.
Description geisserml 2021-02-25 10:58:27 UTC
SUMMARY
I have defined the Compose key to be the right menu key, which worked well on both X11 and Wayland before Plasma 5.21. Since the update, it keeps triggering the context menu on Wayland, regardless of what is configured in the system keyboard settings.

STEPS TO REPRODUCE
0. login to a wayland session
1. start `kcmshell5 kcm_keyboard`
2. go to tab `Advanced`
3. configure `Position of Compose key` to be `Menu`

OBSERVED RESULT
The Menu key, which is set to be the Compose key, triggers the context menu

EXPECTED RESULT
It should not trigger the context menu, but the Compose input

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.21
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.4.0-66-generic
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Input Module is ibus, because otherwise accented keys don't work at all on Wayland (see https://bugs.kde.org/show_bug.cgi?id=411729#c4)
Comment 1 geisserml 2021-03-04 12:18:14 UTC
Any progess on this, guys? Can someone reproduce the described behaviour? I really rely on the compose key for typing French texts, but I would like to keep using Wayland for many reasons
Comment 2 geisserml 2021-03-04 12:20:33 UTC
To be more clear: compose key does not work
Comment 3 geisserml 2021-03-04 12:21:04 UTC
... with any key configured in the settings, not only the menu key
Comment 4 Vlad Zahorodnii 2021-03-05 10:26:16 UTC
Can you attach your .config/kxkbrc file please?
Comment 5 Vlad Zahorodnii 2021-03-05 11:22:10 UTC
For what it's worth, compose key works fine for me. However, I need to set QT_IM_MODULE=compose to make it work in Qt apps.
Comment 6 Andrey 2021-03-05 15:32:52 UTC
Isn't it a duplicate of bug 411729?
Comment 7 geisserml 2021-03-05 16:49:41 UTC
Created attachment 136402 [details]
kxkbrc
Comment 8 geisserml 2021-03-05 16:51:20 UTC
I set QT_IM_MODULE=compose, but compose key still doesn't work (accented keys do, though)
Comment 9 geisserml 2021-03-05 16:53:38 UTC
it also doesn't work in gtk apps like chromium
Comment 10 geisserml 2021-03-05 16:58:46 UTC
compose worked well for me on wayland with ibus as input module before plasma 5.21, so this bug must somehow have been caused by the update
Comment 11 geisserml 2021-03-13 15:11:46 UTC
Does anyone have an idea what could be the cause of this, or what I could do to get rid of the problem? I even created a new user to test, and there is exactly the same problem: regardless of what key I configure in the settings, it will never trigger compose input. It doesn't work in XWayland clients, either.
Comment 12 Tavian Barnes 2021-03-16 16:36:27 UTC
It seems none of the Hardware > Input Devices > Keyboard > Advanced > Configure keyboard options work.  I'm seeing the same issue with the compose key, and the "Make Caps Lock and additional Ctrl" doesn't take effect either.

It doesn't seem to be a dupe of bug 411729.  Running QT_IM_MODULE="" kwrite doesn't help at least.
Comment 13 Andrey 2021-03-16 19:29:47 UTC
(In reply to Manuel Geißer from comment #11)
> Does anyone have an idea what could be the cause of this, or what I could do
> to get rid of the problem?

I see suspicious "VariantList=\\0" line in your kxkbrc, could you try to remove it?
Is any options in the "Hardware > Input Devices > Keyboard > Advanced > Configure keyboard" work for you?
IBus is not needed to check this, so maybe disable temporary.
Comment 14 geisserml 2021-03-17 07:35:06 UTC
(In reply to Andrey from comment #13)
> (In reply to Manuel Geißer from comment #11)
> > Does anyone have an idea what could be the cause of this, or what I could do
> > to get rid of the problem?
> 
> I see suspicious "VariantList=\\0" line in your kxkbrc, could you try to
> remove it?

That fixed it. Thanks!! :)
Comment 15 geisserml 2021-03-17 13:08:38 UTC
Removing this entry temporarily fixes the issue, but apparently there is something that periodically adds it again to the configuration...
Comment 16 geisserml 2021-03-17 13:09:19 UTC
this could be worked around with a login script, though
Comment 17 Andrey 2021-03-17 14:20:22 UTC
(In reply to Manuel Geißer from comment #15)
> Removing this entry temporarily fixes the issue, but apparently there is
> something that periodically adds it again to the configuration...

Probably that's because the configuration rewrites on every start currently, I had a fix for that.
For now, could you confirm the line appears on every restart?
Also, please confirm every option in "Hardware > Input Devices > Keyboard > Advanced > Configure keyboard" stops working.
Also, please check adding one more layout in keyboard configuration solves it. I'll update bug description meanwhile.
Also, could you please attach your journal right after Plasma starts?
And the last question, isn't it happening on X11 at all?
Thanks.
Comment 18 geisserml 2021-03-17 19:29:07 UTC
(In reply to Andrey from comment #17)
> Probably that's because the configuration rewrites on every start currently,
> I had a fix for that.
> For now, could you confirm the line appears on every restart?
Interestingly, it does not. I just restarted and the configuration stayed intact. However, as soon as I tweak any advanced keyboard option, the invalid `VariantList` value appears agian, and can only be removed manually.

> Also, please confirm every option in "Hardware > Input Devices > Keyboard >
> Advanced > Configure keyboard" stops working.
Yes everything does stop working. I initially didn't notice this as the only option relevant for me personally is Compose key... 

> Also, please check adding one more layout in keyboard configuration solves
> it. I'll update bug description meanwhile.
Yes it does - very good finding.

> Also, could you please attach your journal right after Plasma starts?
I don't know how to do that, sorry - could you explain please or point me at some documentation? Is it still relevant, provided that the invalid entry does not reappear on every reboot?

> And the last question, isn't it happening on X11 at all?
No, X11 seems to be completely unaffected.

> Thanks.
No problem, thanks for your effort to investigate the bug!


>> Removing this entry temporarily fixes the issue, but apparently there is
>> something that periodically adds it again to the configuration...
I was wrong. This issue is not periodical - I probably only toggled one of the advanced keyboard settings in the meantime, which caused the invalid entry to reappear.
Comment 19 geisserml 2021-03-20 16:29:37 UTC
(In reply to Manuel Geißer from comment #10)
> compose worked well for me on wayland with ibus as input module before
> plasma 5.21, so this bug must somehow have been caused by the update

By the way, sorry for wrongly accusing 5.21 for the issue, it was of course completely unrelated - I just deleted my second keyboard profile at the same time...
Comment 20 Andrey 2021-03-20 21:31:33 UTC
You might still guessed the version right - I introduced this bug recently ;)
Comment 21 geisserml 2021-03-21 14:24:06 UTC
Lol - that was really coincidence ;)
Comment 22 Bug Janitor Service 2021-03-31 19:33:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/403
Comment 23 Nate Graham 2021-03-31 19:35:50 UTC
*** Bug 435002 has been marked as a duplicate of this bug. ***
Comment 24 Nate Graham 2021-03-31 19:49:44 UTC
*** Bug 433265 has been marked as a duplicate of this bug. ***
Comment 25 Nate Graham 2021-03-31 19:49:48 UTC
*** Bug 433266 has been marked as a duplicate of this bug. ***
Comment 26 Andrey 2021-03-31 19:52:50 UTC
Git commit 1c10a6f6612f09281f4fdcfdba6ba7c250f23f72 by Andrey Butirsky.
Committed on 31/03/2021 at 19:52.
Pushed by butirsky into branch 'master'.

fix broken keyboard configurations with single layout on Wayland

KConfigGroup::writeEntry() shouldn't be used with list - otherwise,
"VariantList=\\0" is saved for the list with single empty item, as a
measure to distinguish it from empty list.
We don't need it here as the list is read directly by external library
on load.

M  +1    -1    kcms/keyboard/keyboard_config.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/1c10a6f6612f09281f4fdcfdba6ba7c250f23f72
Comment 27 Nate Graham 2021-03-31 20:00:51 UTC
Git commit 5e89a55e26b004fc097fd3b544823e88003db066 by Nate Graham, on behalf of Andrey Butirsky.
Committed on 31/03/2021 at 20:00.
Pushed by ngraham into branch 'Plasma/5.21'.

fix broken keyboard configurations with single layout on Wayland

KConfigGroup::writeEntry() shouldn't be used with list - otherwise,
"VariantList=\\0" is saved for the list with single empty item, as a
measure to distinguish it from empty list.
We don't need it here as the list is read directly by external library
on load.


(cherry picked from commit 1c10a6f6612f09281f4fdcfdba6ba7c250f23f72)

M  +1    -1    kcms/keyboard/keyboard_config.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/5e89a55e26b004fc097fd3b544823e88003db066
Comment 28 Nate Graham 2021-04-01 03:19:50 UTC
*** Bug 433265 has been marked as a duplicate of this bug. ***
Comment 29 Andrey 2021-04-02 18:44:39 UTC
*** Bug 432438 has been marked as a duplicate of this bug. ***
Comment 30 geisserml 2021-04-02 19:29:07 UTC
Thanks for fixing this issue!
Comment 31 Andrey 2021-04-18 15:12:39 UTC
Here is why the config was overridden even if you don't touch it.
Happens when you boot X11 session.
Fixed:
https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/433
Comment 32 Patrick Silva 2021-05-31 13:13:19 UTC
*** Bug 433301 has been marked as a duplicate of this bug. ***