Bug 438496 - Keyboard layout switching shortcut stops working after a period of inactivity
Summary: Keyboard layout switching shortcut stops working after a period of inactivity
Status: REOPENED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 5.22.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-12 09:01 UTC by Andrey Fedoseev
Modified: 2023-10-15 06:13 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Fedoseev 2021-06-12 09:01:57 UTC
SUMMARY

After upgrading to KDE 5.22 (KDE Neon), I noticed that the keyboard layout switching shortcut stops working
a period of inactivity.

Initially, I thought that's it's related to suspend/resume cycle, but I can't reproduce it I trigger suspend/resume a few times in a row.

However, if I leave the machine in suspended state for a while, then problems occurs in 100% of the cases.

I also think that it occurs even if machine keeps running, but I just leave it for a while.

I can still switch the layout by clicking on the keyboard layout widget in the panel.

I also noticed that if I go to Settings and change the shortcut key (even if I use the same shortcut, the important thing is to click Apply), then it starts working again as normal.

Normally, I use Right Control key as the shortcut. I also tried adding other combinations (Shift + Shift), they also stop working as described above.


STEPS TO REPRODUCE
1. Assign a shortcut to switch keyboard layout
2. Suspend the machine and leave it for a while (suspending may not be necessary)

OBSERVED RESULT

1. The assigned shortcut stops working


EXPECTED RESULT

1. The assigned shortcut works correctly and switches keyboard layout


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon
KDE Plasma Version: 5.22.0
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION

I captured the keyboard input with `xev` with for both states (the normal state and the faulty state):

Normal state:

KeyRelease event, serial 40, synthetic NO, window 0x9800001,
    root 0x6c4, subw 0x0, time 36824002, (118,67), root:(291,153),
    state 0x2000, keycode 105 (keysym 0xfe08, ISO_Next_Group), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False


Faulty state:

KeyRelease event, serial 40, synthetic NO, window 0x8a00001,
    root 0x6c4, subw 0x0, time 36651384, (96,53), root:(269,139),
    state 0x4, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Comment 1 Andrey Fedoseev 2021-06-12 09:03:14 UTC
Forgot to mention that I use X Session
Comment 2 Andrey 2021-06-15 10:49:54 UTC
Could you please try to investigate if it's the same issue as bug 391322 or not?
Comment 3 Andrey 2021-06-15 14:19:10 UTC
Also, please try to remove/backup your ~/.config/kwinrc and retest.
Comment 4 Andrey 2021-06-15 17:08:34 UTC
Are we speaking about Main shortcut in Keyboard KCM?
If so, please check if corresponded Options= line present in .config/kxkbrc next time it happens to you
Comment 5 Andrey Fedoseev 2021-06-15 18:30:19 UTC
It happened again and I checked the ~/.config/kxkbrc

Here's what I have there:

[$Version]
update_info=kxkb_variants.upd:split-variants

[Layout]
DisplayNames=EN,RU
LayoutList=us,ru
LayoutLoopCount=-1
Model=pc104
Options=grp:rctrl_toggle,grp:shifts_toggle
ResetOldOptions=true
ShowFlag=true
ShowLabel=false
ShowLayoutIndicator=true
ShowSingle=false
SwitchMode=WinClass
Use=true
VariantList=,



The shortcuts are there (but not working).

Also, (probably unrelated), I noticed `ShowFlag=true` there, but the  layout indicator widget doesn't actually show the flag (showing the flag is disabled in the widget config).

I also tried restarting kwin with `kwin --replace` but it didn't help.
Comment 6 Andrey 2021-06-15 18:37:53 UTC
Looks sane, thanks.
Did it happened just after some period of inactivity or suspend took place still?
Also, could you test on Wayland?
Comment 7 Andrey 2021-06-15 19:17:40 UTC
SwitchMode=WinClass might be related, but I don't faced this behavior earlier.

Could you also create new user and retest there maybe (creating minimal changes to the default configuration)?
Comment 8 Andrey Fedoseev 2021-06-16 05:46:05 UTC
I changed SwitchMode to Global to test it and left the computer in suspend for a night.

This morning I noticed this:

1. The keyboard shortcut seems to be working fine
2. The indicator widget in the notification area disappeared

I saw it disappearing before when I had SwitchMode=WinClass, but only for a certain window (the one that is active when I wake the computer). Previously, it disappeared when a certain window was is focus, but re-appeared if I switched to another window. Now, it isn't displayed no matter which window is in focus.

Changing the Switch Mode in System Settings (doesn't matter to which one, the important thing is to click Apply) brings back the widget.
Comment 9 Andrey 2021-06-16 11:33:20 UTC
(In reply to Andrey Fedoseev from comment #8)
> 1. The keyboard shortcut seems to be working fine
> 2. The indicator widget in the notification area disappeared

Does it mean you can still switch layout with the shortcut, but indicator is not displayed?
Comment 10 Andrey Fedoseev 2021-06-16 12:21:04 UTC
> Does it mean you can still switch layout with the shortcut, but indicator is not displayed?

Yes, correct.
Comment 11 Andrey 2021-06-16 12:45:13 UTC
(In reply to Andrey from comment #6)
> Did it happened just after some period of inactivity or suspend took place
> still?
> Also, could you test on Wayland?

Please address this
Comment 12 Andrey Fedoseev 2021-06-16 17:32:40 UTC
> Also, could you test on Wayland?

I'm sorry, but I can't do it at the moment. The Wayland session doesn't start for me, I'm taken back to the login screen.
Comment 13 Andrey 2021-06-16 19:28:36 UTC
(In reply to Andrey from comment #6)
> Did it happened just after some period of inactivity or suspend took place
> still?
So does suspend necessary?
Comment 14 Andrey Fedoseev 2021-06-18 12:55:58 UTC
> So does suspend necessary?

Probably not. Today it happened while the computer was running. I was away from keyboard, though.
Comment 15 Andrey Fedoseev 2021-06-18 12:58:34 UTC
I also want to confirm that after changing SwitchMode to Global I wasn't able to reproduce the original bug from the description. Instead, I see to problem with the indicator widget I described in the comments above.
Comment 16 Andrey 2021-06-18 13:25:37 UTC
It's really weird.
To sort out upgrade problems, could you do the following:
- Create new user and test from it with mostly default configuration
- If it still reproduces, try to repeat on Neon .iso run in Virtual Machine
- If it still there, try previous Plasma release 5.21 on VM to make sure it is a regression.

Please ask if you need any assistance in testing.
Thanks.
Comment 17 Andrey 2021-06-22 13:06:08 UTC
We got some regression in 5.22, investigating.
Could you try to remove 'im-config' package and see if it helps?
Comment 18 Andrey 2021-07-03 15:03:32 UTC
(In reply to Andrey Fedoseev from comment #8)
> 2. The indicator widget in the notification area disappeared

Recently we fixes some problem with disappearing indicator:
https://bugs.kde.org/show_bug.cgi?id=438460
Please update and try.
Comment 19 Bug Janitor Service 2021-07-18 04:33:32 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 Bug Janitor Service 2021-08-02 04:33:38 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now 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

Thank you for helping us make KDE software even better for everyone!
Comment 21 Andrey Fedoseev 2021-10-29 09:25:53 UTC
Sorry for the late reply, here's some the info that's been requested:


> Create new user and test from it with mostly default configuration

Tried that. I experience the same issue with a test user - the indicator disappears after I put the machine to sleep and then turn it on after a large period of inactivity, while being logged in as the test user.


> If it still reproduces, try to repeat on Neon .iso run in Virtual Machine

I'm not sure if that qualifies, but I have another machine running Neon, and I don't have that issue there.


> We got some regression in 5.22, investigating.
> Could you try to remove 'im-config' package and see if it helps?

I tried to remove the `im-config` package but it didn't resolve the issue.
On another machine where there's no such problem, the `im-config` package is installed.

BTW, I'm running Plasma 5.23 at the moment.


Let me know what other information I could provide.
Comment 22 Dmitry 2022-12-16 13:25:54 UTC
ArchLinux, Plasma 5.26.4.
Main shortcut: Caps Lock

The same issue starting from the middle of this year. Just one difference is that in my case layout switching stops to work when the indicator disappears. Switching the policy between window/application level helps.

Please let me know how I can help to investigate it.
Comment 23 Denis Klychkov 2023-10-15 05:54:13 UTC
I also have this issue for several years. It happens only in X session when switching mode is set to anything but "Global". I experienced it in Arch, OpenSUSE and Manjaro. It relates neither to suspending the PC, nor to inactivity periods. I used to catch it during my active work. At some moment the layout switching hotkey stops working. I have to open settings and reapply them. Finally I gave up with it when I had to re-enable the hotkeys three or four times in an hour. Now I have to use the "Global" switching mode, as it is the only working option.

I can try to investigate and even fix it if somebody shows me possible places to look for the issue.