Bug 284773

Summary: Keyboard Layout Widget: Specific "Change Layout" shortcuts change only to the previous language.
Product: [Applications] systemsettings Reporter: Dotan Cohen <kde-2011.08>
Component: kcm_keyboard_layoutAssignee: Andriy Rysin <arysin>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck, kde-2011.08
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.3
Sentry Crash Report:

Description Dotan Cohen 2011-10-23 11:56:14 UTC
The current implementation of the "Change Layout" shortcuts only work for the previous language used.

Steps to reproduce:

1) Configure four layouts, each with a keyboard shortcut. For purposes of discussion I have set:
English: Meta-1
Hebrew: Meta-2
Russian: Meta-3
Colemak: Meta-4

2) Set Main Layout Count to 2 (so that the general Next Layout shortcut will only swap between two languages).

3) Click Apply and save all settings.

4) Open Kate, type in English. Press Meta-2 to switch to Hebrew. This works fine.

5) Press Meta-3 to switch to Russian. This does not work!

6) Press Meta-1 to switch to English. This works (as English was the previous language).



The user expects to be able to switch to any arbitrary language as per his configured shortcuts.
Comment 1 Christoph Feck 2011-10-26 21:06:08 UTC
Looks like setting the Layout Count to 2 effectively disables the 3rd and 4th layout shortcuts. Does setting the Count to 3 allow you to switch in any order between Meta+1, Meta+2, and Meta+3 regardless of previous layout?
Comment 2 Andriy Rysin 2011-10-27 03:29:19 UTC
I could reproduce it - will take a look
Comment 3 Dotan Cohen 2011-10-27 07:10:41 UTC
> Does setting the Count to 3 allow you to switch in any order
> between Meta+1, Meta+2, and Meta+3 regardless of previous layout?

Yes, with the Main Layout Count set to 3 I can use the last 3 keyboard shortcuts, but cannot access the fourth.
Comment 4 Andriy Rysin 2011-10-28 01:20:44 UTC
Git commit c282b201999af6d75e0d9227fd6a1d106beef975 by Andriy Rysin.
Committed on 28/10/2011 at 03:13.
Pushed by rysin into branch 'KDE/4.7'.

Fix switching to spare keyboard layouts with global shortcut
BUG: 284773
FIXED-IN: 4.7.3

M  +4    -1    kcontrol/keyboard/keyboard_daemon.cpp
M  +17   -10   kcontrol/keyboard/layouts_menu.cpp
M  +1    -0    kcontrol/keyboard/layouts_menu.h

http://commits.kde.org/kde-workspace/c282b201999af6d75e0d9227fd6a1d106beef975
Comment 5 Andriy Rysin 2011-10-28 01:20:44 UTC
Git commit d55e6f6da0e6b0114adf42b506ce39c79ffe2ed8 by Andriy Rysin.
Committed on 28/10/2011 at 03:13.
Pushed by rysin into branch 'master'.

Fix switching to spare keyboard layouts with global shortcut
BUG: 284773
FIXED-IN: 4.8

M  +4    -1    kcontrol/keyboard/keyboard_daemon.cpp
M  +17   -10   kcontrol/keyboard/layouts_menu.cpp
M  +1    -0    kcontrol/keyboard/layouts_menu.h

http://commits.kde.org/kde-workspace/d55e6f6da0e6b0114adf42b506ce39c79ffe2ed8
Comment 6 Dotan Cohen 2011-10-28 07:37:35 UTC
Thank you Andriy!
Comment 7 Christoph Feck 2011-10-28 09:15:05 UTC
Andriy, please use merges or "git cherry-pick -x" to forward-/backwordport a patch. I usually fix in branch (and set the fixed-in version there), then pick that patch in master.