aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2015-02-19 12:33:44 -0500
committerWilliam Hua <william.hua@canonical.com>2015-02-19 12:33:44 -0500
commitec6c31099a0e001554f3ab167b60545808e87301 (patch)
treec0e624146de8a0227968002f72982f9bcb0418eb /lib
parent9cdbb03cab972221b36151e852d8412179483c4a (diff)
downloadayatana-indicator-keyboard-ec6c31099a0e001554f3ab167b60545808e87301.tar.gz
ayatana-indicator-keyboard-ec6c31099a0e001554f3ab167b60545808e87301.tar.bz2
ayatana-indicator-keyboard-ec6c31099a0e001554f3ab167b60545808e87301.zip
Explain input source cycling logic.
Diffstat (limited to 'lib')
-rw-r--r--lib/main.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 877d7b7b..d3e063d1 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -897,6 +897,13 @@ public class Indicator.Keyboard.Service : Object {
jump = sources.length - jump;
}
+ /*
+ * We need to cycle through offset valid input sources, skipping those that aren't
+ * valid for this session (i.e. skipping Fcitx ones if IBus is active and vice-versa.
+ * jump is the direction we need to cycle in, which is 1 if we want to cycle forward
+ * and -1 (mod sources.length) if we want to cycle backward.
+ */
+
for (; offset > 0; offset--) {
do {
current = (current + jump) % sources.length;