From ec6c31099a0e001554f3ab167b60545808e87301 Mon Sep 17 00:00:00 2001 From: William Hua Date: Thu, 19 Feb 2015 12:33:44 -0500 Subject: Explain input source cycling logic. --- lib/main.vala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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; -- cgit v1.2.3