Correct comment for Sample and Suppress property

The data in the property is actually the other way round. Oops.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Remove unused variable

src/wcmUSB.c:451:14: warning: unused variable 'private' [-Wunused-variable]
  wcmUSBData* private = common->private;

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Fix const warnings in wcmSetActionProperty

  CC       wcmXCommand.lo
../../src/wcmXCommand.c: In function 'wcmSetActionProperty':
../../src/wcmXCommand.c:460:23: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
    case BadMatch: msg = "BadMatch"; break;
                       ^
../../src/wcmXCommand.c:461:23: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
    case BadValue: msg = "BadValue"; break;
                       ^
../../src/wcmXCommand.c:462:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
    default: msg = "UNKNOWN"; break;
                 ^
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
wacom 0.20.99.1

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
wacom 0.21.0

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
xsetwacom: add special mappings for Home, End, Delete

These three are likely written as home, end, del, so let's try to
understand that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
xsetwacom: if we fail to map a string, try as special key or warn

If a string comes back with a KeySym of 0, try again as a special key. And
if that fails too, print a warning.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
xsetwacom: map a bunch of special symbols

Punctuation marks and others map to XK_* keysyms but only in their named
form, not in their single-character symbol form.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
man: clarify how to configure keys on higher shift levels in xsetwacom

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Purge TILT_REQUEST_FLAG

Write-only value, obsolete as of xf86-input-wacom-0.10.4-45-gba90433

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pinglinux@gmail.com>
Plug memory leaks left by xf86SetStrOption

xf86SetStrOption() returns a strdup'd string that needs to be freed after
use.

This requires some const char* → char* changes too, for things that were
never really const char* to begin with anyway.

wcmEventAutoDevProbe() can use xf86CheckStrOption so it too returns a
strup that we can free lateron.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Free duplicated option list after conversion to InputOption

The duplicated list is a copy (as the comment in the server says) and thus
must be freed.

==27895== 947 (40 direct, 907 indirect) bytes in 1 blocks are definitely lost in loss record 266 of 311
==27895==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==27895==    by 0x4E538C: addNewOption2 (Flags.c:203)
==27895==    by 0x4E5401: xf86addNewOption (Flags.c:216)
==27895==    by 0x4AEB24: xf86AddNewOption (xf86Option.c:347)
==27895==    by 0x4AE54B: xf86OptionListDuplicate (xf86Option.c:152)
==27895==    by 0xB74D139: wcmOptionDupConvert (wcmValidateDevice.c:382)
==27895==    by 0xB74D408: wcmQueueHotplug (wcmValidateDevice.c:515)
==27895==    by 0xB74D645: wcmHotplugOthers (wcmValidateDevice.c:568)
==27895==    by 0xB742DA2: wcmPreInit (wcmConfig.c:599)
==27895==    by 0x4C1ACF: xf86NewInputDevice (xf86Xinput.c:846)
==27895==    by 0x4C2014: NewInputDeviceRequest (xf86Xinput.c:989)
==27895==    by 0x4DD72C: device_added (udev.c:231)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Free input attribute's product

This is copied first by DuplicateInputAttributes, then asprintf makes
another copy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Free the touch mask on shutdown

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Free the device name after reassigning

When hotplugging the first tool (usually the stylus) changes pInfo->name to
the name + tool name. Thus, free the original one.

And strdup the oldname so we can unconditially free it, regardless of
whether we changed the actual device name or not.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Don't init abswheel2 valuator (7th val) if we don't have one

InitValuatorAxisStruct() will return if the axisnum > num_axes and not
initialise anything which is why the current code worked without issues.

With a new patch to the server this will now complain with an error message
to the log.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Add support for Cintiq 22HDT and 13HD, DTK2241 and DTH2242.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't emulate a mouse when multitouch is enabled

Currently when enabling XI 1.2 multitouch events the Wacom driver does a
strange mix of emulating a mouse (when there is only touch) and
switches suddenly switches to be a touchscreen when 2 fingers are down.

Change this to only send touch events when using multitouch mode, such
that the touchscreen works the same as other touchscreens. This enables
applications to properly respond to one finger touches (e.g. panning
in GTK+).

The X server core will still send emulated input events to applications
not supporting multitouch, so there shouldn't be a regression for those
applications.

Signed-off-by: Sjoerd Simons <sjoerd@greynoise.nl>
Acked-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Transform touch events just like all other events

Transform touch coordinates in the same way as other events coming from
the wacom driver otherwise setting for exmaple the Wacom Rotation
property has no effect

Signed-off-by: Sjoerd Simons <sjoerd@greynoise.nl>
Acked-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Add xf86OptionListFree for distcheck

Signed-off-by: Ping Cheng <pingc@wacom.com>