xserver: Branch 'master' - 3 commits

Daniel Stone daniel at fooishbar.org
Tue Jan 31 01:14:45 PST 2012


Hi,

On 31 January 2012 04:56, Keith Packard <keithp at kemper.freedesktop.org> 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


More information about the xorg-devel mailing list