test/x11comp: server writes \n to displayfd

Signed-off-by: Ran Benita <ran234@gmail.com>
state: no need for loop in xkb_state_update_mask()

Signed-off-by: Ran Benita <ran234@gmail.com>
Make the effective mod mask calculation available to other files

We will want to use that function in state.c as well.

Signed-off-by: Ran Benita <ran234@gmail.com>
state: make sure the mods are fully resolved after xkb_state_update_mask()

Virtual modifiers can have "mappings" to real modifiers, e.g. NumLock
may also set Mod2. In a normal turn of events, the various components
(depressed, latched, locked, and consequently effective) include the
mapped mods, because the masks are pre-resolved everywhere. However,
xkb_state_update_mask() accepts arbitrary mod masks, which may not be
resolved (if it comes from somewhere other than
xkb_state_serialize_mods()). So let's always resolve them ourselves.

Signed-off-by: Ran Benita <ran234@gmail.com>
test/state: add test_update_mask() test

Signed-off-by: Ran Benita <ran234@gmail.com>