wintab: Incorrectly classifying cursor as stylus instead of eraser

Alexandre Julliard julliard at
Fri Mar 21 03:54:24 CDT 2014

Eriks Dobelis <eriks.dobelis at> writes:

> The alternative - just to switch order of checks in
> X11DRV_LoadTabletInfo. There is a code fragment:
>             /* prefer finding TYPE_PEN(most capable) */
>             if (is_stylus(target->name, device_type))
>                 cursor.TYPE = CSR_TYPE_PEN;
>             else if (is_eraser(target->name, device_type))
>                 cursor.TYPE = CSR_TYPE_ERASER;
>             else
>                 cursor.TYPE = CSR_TYPE_OTHER;
> I would need to switch order and check for ERASER first. Problems
> would arise if for some device name would be "Pen & Eraser", and type
> would be "STYLUS" , and then it would be detected as eraser. In the
> proposed patch this problem would not arise as only device is checked
> for ERASER. For my specific case both approaches work. Which one you
> consider as better?

Maybe a better way would be to restructure the checks, and give priority
to the type over the name or something like that. The thing is that we
don't want to have an is_stylus function that also checks for erasers,
and then an is_eraser function with slightly different checks.

Alexandre Julliard
julliard at

More information about the wine-devel mailing list