state: special case effective group in layout_is_active
authorRan Benita <ran234@gmail.com>
Fri, 21 Sep 2012 09:45:58 +0000 (12:45 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Sun, 23 Sep 2012 23:08:53 +0000 (09:08 +1000)
commited78fbcb30888cbfc6cd00fb0d56e412ed8bda6c
tree03b8830bd28e6ce2cbf1fc61c0c51b7904bcaa9c
parenta8b932a032e1c264c7f89b7eadcb2325b09c117f
state: special case effective group in layout_is_active

Currently, xkb_state_layout_{index,name}_is_active may report multiple
groups as effective, because at looks at base,latched,locked separately.
But there can only be one effective group, which is computed from the
other three. So if XKB_STATE_EFFECTIVE is requested, just compare to the
effective group we have computed.

We also modify mod_{index,name}_is_active similarly, just for symmetry
(there the effective mask is just an OR of the other three so the
current test is correct).

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