Bug 470737

Summary: Keyboard layout indicator randomly disappears on X11
Product: [Plasma] plasmashell Reporter: Foresteam <heler1141>
Component: Keyboard LayoutAssignee: Plasma Bugs List <plasma-bugs>
Status: REPORTED ---    
Severity: normal CC: butirsky, nate
Priority: NOR    
Version: 5.27.5   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
URL: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/951
See Also: https://bugs.kde.org/show_bug.cgi?id=456391
https://bugs.kde.org/show_bug.cgi?id=457156
https://bugs.kde.org/show_bug.cgi?id=476830
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: wrong file
Journalctl logs
The disappeared indicator

Description Foresteam 2023-06-07 08:20:56 UTC
Created attachment 159509 [details]
wrong file

SUMMARY
The layout indicator in KDE (apparently) randomly disappears under unknown conditions. Layout switching still works, though.


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.1.32-1-lts
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
X11
Comment 1 Andrey 2023-06-07 08:26:19 UTC
What happens with Wayland?
Comment 2 Foresteam 2023-06-07 08:30:24 UTC
SUMMARY
The layout indicator in KDE (apparently) randomly disappears from the panel under unknown conditions. Layout switching still works, though.
I don't change any settings, but the problem persists.
Sometimes i just notice it's gone, and to return it i need to change locale settings. For example, switching "OSD on layout change" option on/off returns the indicator.
I tried:
1. Installing a flatpak version of Telegram (it could be the culprit, but it wasn't)
2. Setting options of the tray to always display the indicator (was set to "show when relevant"), nothing changed

OBSERVED RESULT
The keyboard indicator randomly disappears from the system tray (completely).

EXPECTED RESULT
Should be always shown when it's set to.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.1.32-1-lts
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
X11
Comment 3 Foresteam 2023-06-07 08:31:00 UTC
Created attachment 159510 [details]
Journalctl logs
Comment 4 Andrey 2023-06-07 08:32:57 UTC
It still doesn't answer the question? ^
Comment 5 Foresteam 2023-06-07 08:35:43 UTC
(In reply to Andrey from comment #1)
> What happens with Wayland?

I don't use it. I tried to switch, but encountered a bunch of problems i don't have on X11 or had fixed them.
Also, the bug started to show up even before i've switched to Arch (was Manjaro, previously). 1.5 month in total, approximately.
Comment 6 Andrey 2023-06-07 08:38:24 UTC
Can you try to reproduce on Wayland at least? It's important to further investigation.
Comment 7 Foresteam 2023-06-07 09:41:54 UTC
I'll try to, but i can't even reliably reproduce it on X11. As i said, it occurs randomly.
I also just noticed that "OSD on layout change" was doing nothing on X11 (excluding "fixing" the layout indicator) while on wayland it actually shows an OSD. Mb it's somehow related.
Also, i had completely wiped system files and configs during my switch to Arch, but left user folders untouched. So it may be related to my user space itself.
Comment 8 Nate Graham 2023-06-07 18:49:38 UTC
Is the screenshot showing the right thing? It doesn't appear to show anything from Plasma.
Comment 9 Foresteam 2023-06-08 07:57:18 UTC
Created attachment 159531 [details]
The disappeared indicator
Comment 10 Andrey 2023-06-08 08:03:50 UTC
Can it be somehow related to your USB/Bluetooth keyboard become reattached or something like this?
Comment 11 Andrey 2023-06-08 10:19:50 UTC
Try also to find correlation with this lines in the log when it happens:
Jun 07 11:06:14 agenda plasmashell[934]: file:///usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/contents/ui/main.qml:23: TypeError: Value is undefined and could not be converted to an object
Jun 07 11:06:14 agenda plasmashell[934]: file:///usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/contents/ui/main.qml:86: TypeError: Value is undefined and could not be converted to an object
Jun 07 11:06:14 agenda plasmashell[934]: file:///usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/contents/ui/main.qml:63: TypeError: Value is undefined and could not be converted to an object
Comment 12 Andrey 2023-06-08 10:26:55 UTC
Also, as a quick hack, try to comment out this line in the .qml file and see if it helps (restart Plasma after that):
        Plasmoid.status: hasMultipleKeyboardLayouts ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus
https://invent.kde.org/plasma/plasma-desktop/-/blob/master/applets/keyboardlayout/contents/ui/main.qml#L28
Comment 13 Foresteam 2023-06-14 04:42:02 UTC
(In reply to Andrey from comment #10)
> Can it be somehow related to your USB/Bluetooth keyboard become reattached
> or something like this?

My PC has no Bluetooth. The only USB device i periodically reattach is my webcam.
Comment 14 Andrey 2023-06-14 04:52:05 UTC
That webcam actually might be the reason, we have related fix which wasn't merged.
Could you retest without it?
Comment 15 Foresteam 2023-06-16 10:06:05 UTC
(In reply to Andrey from comment #12)
> Also, as a quick hack, try to comment out this line in the .qml file and see
> if it helps (restart Plasma after that):
>         Plasmoid.status: hasMultipleKeyboardLayouts ?
> PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus
> https://invent.kde.org/plasma/plasma-desktop/-/blob/master/applets/
> keyboardlayout/contents/ui/main.qml#L28

This seems to have solved it. Or at least i didn't notice it happen again. Now the indicator "freezes", showing the wrong layout until i press the switch combination again.
Some software has been updated through this time, though:
* Linux 6.1.33-1-lts
* KDE Plasma Version: 5.27.5
* KDE Frameworks Version: 5.107.0
* Qt Version: 5.15.10
Comment 16 Andrey 2023-06-16 10:26:54 UTC
So it "fixes" a symptom and not the reason.
For the reason, patch I mentioned above might be useful.
But first I wish you test without the webcam or other auxiliary USB devices.
Comment 17 Foresteam 2023-06-16 16:50:54 UTC
(In reply to Andrey from comment #16)
> So it "fixes" a symptom and not the reason.
> For the reason, patch I mentioned above might be useful.
> But first I wish you test without the webcam or other auxiliary USB devices.

Not "fixes", actually. A few hours ago it stuck completely and i had to use that checkbox in settings again.
Comment 18 Andrey 2023-06-18 06:37:35 UTC
(In reply to Andrey from comment #16)
> For the reason, patch I mentioned above might be useful.
> But first I wish you test without the webcam or other auxiliary USB devices.
Comment 19 Bug Janitor Service 2023-07-03 03:45:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 20 Foresteam 2023-07-07 10:06:42 UTC
(In reply to Andrey from comment #18)
> (In reply to Andrey from comment #16)
> > For the reason, patch I mentioned above might be useful.
> > But first I wish you test without the webcam or other auxiliary USB devices.

It's indeed probably related to the webcam. As i plug it in, i sometimes notice the bug in an hour or less.
Comment 21 Foresteam 2023-08-04 08:25:52 UTC
(In reply to Foresteam from comment #20)
> (In reply to Andrey from comment #18)
> > (In reply to Andrey from comment #16)
> > > For the reason, patch I mentioned above might be useful.
> > > But first I wish you test without the webcam or other auxiliary USB devices.
> 
> It's indeed probably related to the webcam. As i plug it in, i sometimes
> notice the bug in an hour or less.

Immediately, actually.
Comment 22 Andrey 2024-01-14 21:48:04 UTC
This might be the fix, any chance you could check it yourself? Compiling involved:
https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/951