[PATCH 23/42] dix: add touch event history helper functions

Chase Douglas chase.douglas at canonical.com
Mon Dec 19 18:52:21 PST 2011


On Dec 14, 2011, at 7:02 PM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> +    ti->history[ti->history_elements++] = *ev;
> +    /* FIXME: proper overflow fixes */
> +    ti->history_elements = min(ti->history_elements, ti->history_size - 1);

I would like to see this broken into

if (ti->history_elements > ti->history_size -1)
{
    ti->history_elements = ti->history_size -1;
    DebugF("%s: touch %u history overflowed at %d events\n", <device name>, ti->client_id, TOUCH_HISTORY_SIZE);
}

It's an as-yet untested functionality with a number picked out of thin air, so logging this may help fix bad client behavior and/or find a better size.

-- Chase


More information about the xorg-devel mailing list