@@ -51,6 +51,9 @@ QtObject {
51 nextIndex = currentKeymapIndex + 1;
51 nextIndex = currentKeymapIndex + 1;
53 currentKeymapIndex = nextIndex;
53 currentKeymapIndex = nextIndex;
54+ if (actionGroup.currentAction.valid) {
55+ actionGroup.currentAction.updateState(currentKeymapIndex);
56 function previousKeymap() {
59 function previousKeymap() {
@@ -60,30 +63,35 @@ QtObject {
60 prevIndex = currentKeymapIndex - 1;
63 prevIndex = currentKeymapIndex - 1;
62 currentKeymapIndex = prevIndex;
65 currentKeymapIndex = prevIndex;
66+ if (actionGroup.currentAction.valid) {
67+ actionGroup.currentAction.updateState(currentKeymapIndex);
65− property Binding surfaceKeymapBinding: Binding {
71+ property Binding surfaceKeymapBinding: Binding { // NB: needed mainly for xmir & libertine apps
66 target: root.focusedSurface
72 target: root.focusedSurface
67 property: "keymap"
73 property: "keymap"
68 value: root.currentKeymap
74 value: root.currentKeymap
77+ property Binding unityKeymapBinding: Binding {
79+ property: "currentKeymap"
80+ value: root.currentKeymap
71 // indicator
83 // indicator
72 property QDBusActionGroup actionGroup: QDBusActionGroup {
84 property QDBusActionGroup actionGroup: QDBusActionGroup {
73 busType: DBus.SessionBus
85 busType: DBus.SessionBus
74 busName: "com.canonical.indicator.keyboard"
86 busName: "com.canonical.indicator.keyboard"
75 objectPath: "/com/canonical/indicator/keyboard"
87 objectPath: "/com/canonical/indicator/keyboard"
77− property variant currentAction: action("current")
89+ property variant currentAction: action("current") // the one that's checked by the indicator
78− property variant activeAction: action("active")
90+ property variant activeAction: action("active") // the one that we clicked
80 Component.onCompleted: actionGroup.start();
92 Component.onCompleted: actionGroup.start();
83− onCurrentKeymapIndexChanged: {
84− actionGroup.currentAction.updateState(currentKeymapIndex);
87 readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
95 readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
89 onActiveActionStateChanged: {
97 onActiveActionStateChanged: {