Hi,

On 31 January 2012 04:56, Keith Packard <[email protected]> wrote:
> +        if (pDev->key) {
> +            for (i = 0; i < NUM_KEYCODES; i++) {
> +                if (BitIsOn(pDev->key->down, i + MIN_KEYCODE)) {
> +                    QueueKeyboardEvents(pDev, KeyRelease, i + MIN_KEYCODE, 
> NULL);
> +                }
> +            }
> +        }

You should be using key_is_down(pDev, i + MIN_KEYCODE, KEY_POSTED),
rather than directly poking pDev->key->down.  This also eliminates a
small race where you might fail to release a key because the event has
been put in the event queue, but not processed.

Cheers,
Daniel
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to