From: Ran Benita Date: Wed, 19 Sep 2012 12:56:07 +0000 (+0300) Subject: state: handle ACTION_LOCK_NO_{UN,}LOCK for mods X-Git-Tag: xkbcommon-0.2.0~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b66afc4e7682da72206c23d724c16326220230c;p=platform%2Fupstream%2Flibxkbcommon.git state: handle ACTION_LOCK_NO_{UN,}LOCK for mods xkblib spec says: XkbSA_LockNoLock If set, and the action type is XkbSA_LockMods, the server only unlocks the action modifiers. XkbSA_LockNoUnlock If set, and the action is XkbSA_LockMods, the server only locks the action modifiers. Signed-off-by: Ran Benita --- diff --git a/src/state.c b/src/state.c index 14a95af..a89d365 100644 --- a/src/state.c +++ b/src/state.c @@ -265,7 +265,9 @@ xkb_filter_mod_lock_func(struct xkb_state *state, if (--filter->refcnt > 0) return 0; - state->locked_mods &= ~filter->priv; + state->clear_mods |= filter->action.mods.mods.mask; + if (!(filter->action.mods.flags & ACTION_LOCK_NO_UNLOCK)) + state->locked_mods &= ~filter->priv; filter->func = NULL; return 1; @@ -275,7 +277,9 @@ static void xkb_filter_mod_lock_new(struct xkb_state *state, struct xkb_filter *filter) { filter->priv = state->locked_mods & filter->action.mods.mods.mask; - state->locked_mods |= filter->action.mods.mods.mask; + state->set_mods |= filter->action.mods.mods.mask; + if (!(filter->action.mods.flags & ACTION_LOCK_NO_LOCK)) + state->locked_mods |= filter->action.mods.mods.mask; } enum xkb_key_latch_state {