@@ -51,6 +51,9 @@ QtObject {
5151 nextIndex = currentKeymapIndex + 1;
5252 }
5353 currentKeymapIndex = nextIndex;
54+ if (actionGroup.currentAction.valid) {
55+ actionGroup.currentAction.updateState(currentKeymapIndex);
56+ }
5457 }
5558
5659 function previousKeymap() {
@@ -60,30 +63,35 @@ QtObject {
6063 prevIndex = currentKeymapIndex - 1;
6164 }
6265 currentKeymapIndex = prevIndex;
66+ if (actionGroup.currentAction.valid) {
67+ actionGroup.currentAction.updateState(currentKeymapIndex);
68+ }
6369 }
6470
65− property Binding surfaceKeymapBinding: Binding {
71+ property Binding surfaceKeymapBinding: Binding { // NB: needed mainly for xmir & libertine apps
6672 target: root.focusedSurface
6773 property: "keymap"
6874 value: root.currentKeymap
6975 }
7076
77+ property Binding unityKeymapBinding: Binding {
78+ target: Mir
79+ property: "currentKeymap"
80+ value: root.currentKeymap
81+ }
82+
7183 // indicator
7284 property QDBusActionGroup actionGroup: QDBusActionGroup {
7385 busType: DBus.SessionBus
7486 busName: "com.canonical.indicator.keyboard"
7587 objectPath: "/com/canonical/indicator/keyboard"
7688
77− property variant currentAction: action("current")
78− property variant activeAction: action("active")
89+ property variant currentAction: action("current") // the one that's checked by the indicator
90+ property variant activeAction: action("active") // the one that we clicked
7991
8092 Component.onCompleted: actionGroup.start();
8193 }
8294
83− onCurrentKeymapIndexChanged: {
84− actionGroup.currentAction.updateState(currentKeymapIndex);
85− }
86−
8795 readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
8896
8997 onActiveActionStateChanged: {