state: light indicator when either condition is satisfied
authorRan Benita <ran234@gmail.com>
Mon, 27 Aug 2012 08:51:37 +0000 (11:51 +0300)
committerRan Benita <ran234@gmail.com>
Sun, 2 Sep 2012 16:17:09 +0000 (19:17 +0300)
commita45b7d75592933b15b1b3f7a22e2fbd9213ab62d
tree6ec1189822c7f6ef43bff6b515892e62af00d46f
parentd1b476a387b2515ed296181afecd74cceb87b232
state: light indicator when either condition is satisfied

For the indicator to be set, it is sufficient for at least one of the
group, modifier, or control state to match; this is in line with the
xkblib spec, section 8.2 and ComputeAutoState() in xserver/xkb/xkbLEDs.c
(though the xserver implementation differs from the spec on some
points...).

This also adds a tiny optimization to skip the entire check if the mask
is empty.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/state.c