@@ -37,7 +37,8 @@ Item {
38 readonly property var keymaps: AccountsService.keymaps
38 readonly property var keymaps: AccountsService.keymaps
39 readonly property int keymapCount: keymaps.length
39 readonly property int keymapCount: keymaps.length
40+ // default keymap, either the one remembered by the indicator, or the 1st one selected by user
40− property int currentKeymapIndex: 0
41+ property int currentKeymapIndex: actionGroup.currentAction.valid ? actionGroup.currentAction.state : 0
41 readonly property string currentKeymap: keymaps[currentKeymapIndex]
42 readonly property string currentKeymap: keymaps[currentKeymapIndex]
43 function nextKeymap() {
44 function nextKeymap() {
@@ -72,6 +73,10 @@ Item {
72 objectPath: "/com/canonical/indicator/keyboard"
73 objectPath: "/com/canonical/indicator/keyboard"
74 property variant currentAction: action("current")
75 property variant currentAction: action("current")
76+ property variant activeAction: action("active")
79+ Component.onCompleted: actionGroup.start();
77 onCurrentKeymapIndexChanged: {
82 onCurrentKeymapIndexChanged: {
@@ -79,11 +84,12 @@ Item {
79 actionGroup.currentAction.updateState(currentKeymapIndex);
84 actionGroup.currentAction.updateState(currentKeymapIndex);
87+ readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
83− Component.onCompleted: {
89+ onActiveActionStateChanged: {
84− actionGroup.start();
90+ print("!!! Active keymap changed (via indicator) to:", activeActionState);
85− if (actionGroup.currentAction.valid) {
91+ if (activeActionState != -1) {
86− // TODO root.currentKeymapIndex = actionGroup.activeAction.state; // restore keymap saved by the indicator
92+ currentKeymapIndex = activeActionState;