[PATCH] [xserver] xkb: Cancel a key's repetition when its autorepeat is disabled.

Peter Hutterer peter.hutterer at who-t.net
Sun Jan 23 16:02:58 PST 2011


On Fri, Jan 21, 2011 at 10:11:41AM +0200, Erkki Seppälä wrote:
> When XkbChangeEnabledControls is called to disable key repetition of a
> certain key (or keys), currently ongoing repetition of that key was
> not cancelled. It was cancelled if ChangeKeyboardControl was used to
> disable key repetition globally.
> 
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> ---
>  xkb/xkb.c |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/xkb/xkb.c b/xkb/xkb.c
> index 7d95bc0..4a2590b 100644
> --- a/xkb/xkb.c
> +++ b/xkb/xkb.c
> @@ -915,9 +915,19 @@ ProcXkbSetControls(ClientPtr client)
>                                         stuff->axtOptsMask);
>              }
>  
> -            if (stuff->changeCtrls & XkbPerKeyRepeatMask)
> +            if (stuff->changeCtrls & XkbPerKeyRepeatMask) {
> +                unsigned key;
> +
>                  memcpy(new.per_key_repeat, stuff->perKeyRepeat,
>                         XkbPerKeyBitArraySize);
> +                for (key = 0; key < 8 * XkbPerKeyBitArraySize; ++key) {
> +                    unsigned idx = key / 8;
> +                    unsigned bit = key % 8;
> +                    if (!(new.per_key_repeat[idx] & (1 << bit))) {
> +                        AccessXCancelRepeatKey(xkbi, key);
> +                    }
> +                }
> +            }
>  
>              old= *ctrl;
>              *ctrl= new;
> -- 
> 1.7.0.4

merged, thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list