xserver: Branch 'master' - 3 commits
Jeremy Huddleston
jeremyhu at apple.com
Tue Jan 31 10:06:19 PST 2012
On Jan 31, 2012, at 1:14 AM, Daniel Stone wrote:
> 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.
Ah, I missed that. I should use button_is_down similarly.
More information about the xorg-devel
mailing list