server/touch: fix button state checks on touch events

The protocol states that the button state on touch events must represent the
state of physical buttons only. Thus, the state must always be 0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: ButtonState check only works on XI2.2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: Add test for Button1Motion mask on emulated pointer motion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: register for XI2.2 before selecting events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
common/helpers: use booleans instead of defines

This is C++, we do have a boolean type.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
common/helper: fix error trap for stack-local XError

The error Xlib passes to the error handler is stack-local. Saving its
address is entertaining, but largely useless.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
common/helpers: fix ASSERT_ERROR to avoid double-calling its argument

Reported-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
common/helpers: move QueryPointerPosition to helpers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: add event history replaying test

Create a window hierarchy and grab + select for events on two of those
windows, then replay the event sequence and compare it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: add pointer jump test

Moving a touch device, then a mouse device must move the pointer from the
last position of the touch, not jump back elsewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: Add test for DeviceChangedEvents between touch/mouse events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/multihead: split config writing into a separate function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/multihead: insert parent class before ZaphodTest

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/multihead: add zaphod test for pointer-to-touch cursor jumps

This is a test for https://bugs.freedesktop.org/show_bug.cgi?id=55477 in
zaphod configuration, but really just a confirmation that
TouchDeviceChangeTest.NoCursorJumpsOnTouchToPointerSwitch also works on
zaphods.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/misc: add screen saver test

https://bugs.freedesktop.org/show_bug.cgi?id=56649

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server: Move all tests into a single binary

Using gtest_filter is better to run select tests only than to split those
into multiple binaries. The danger of forgetting to run one binary and not
noticing test breakages is high otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server/touch: add test for jumping cursor on missing touch valuators

https://bugs.freedesktop.org/show_bug.cgi?id=49347

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
server: Add more tests for pointer barriers

This time, ensure that our device implementation works correctly.
server: Add tests for pointer barrier notify events