Peter Hutterer [Thu, 15 May 2014 23:06:41 +0000 (09:06 +1000)]
Add an enum for configuration return codes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Thu, 3 Jul 2014 01:00:54 +0000 (11:00 +1000)]
test: fix compiler warnings for comparison int vs unsigned int
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 3 Jul 2014 00:52:40 +0000 (10:52 +1000)]
configure: print a summary of the build options
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:32:02 +0000 (09:32 +1000)]
Fix compiler warnings for missing initializers
timer.c: In function ‘libinput_timer_arm_timer_fd’:
timer.c:48: warning: missing initializer
timer.c:48: warning: (near initialization for ‘its.it_value.tv_nsec’)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:30:40 +0000 (09:30 +1000)]
Add -lrt to the libs
Needed for clock_gettime()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:29:22 +0000 (09:29 +1000)]
configure: check for -lm through AC_CHECK_LIB
Saves us from manually appending it everywhere
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:59:26 +0000 (09:59 +1000)]
Fix two doxygen refs pointing to nonexistent functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:57:12 +0000 (09:57 +1000)]
tools: fix touch/abs event coordinate transformation in event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:54:29 +0000 (09:54 +1000)]
tools: draw the circle for abs events in the right position
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 2 Jul 2014 23:53:35 +0000 (09:53 +1000)]
touchpad: log the sysname of the device that looks like a bad clickpad
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 1 Jul 2014 12:53:18 +0000 (14:53 +0200)]
touchpad: Switch to smooth simple acceleration code from filter.c
The old touchpad accel code was clamping touchpad acceleration between
0.2 and 0.4, and on the test devices I have the constant_factor ended up
such that in practice the accel was almost always 0.2, so rather than having
a velocity based acceleration curve, in essence it was just always using an
acceleration of 0.2 .
This commit introduces actual velocity based acceleration based on the
recently added smooth simple acceleration code from filter.c .
Before feeding motion events to filter.c, they first get adjusted for touchpad
resolution. For touchpads where the driver does not provide resolution info,
scale based on the diagonal-size in units instead.
While at it rename tp_init_accel's dispatch parameter from touchpad to tp
to be consistent with all other functions.
Since the acceleration is also used for scrolling also adjust the scroll
start threshold for these changes.
Note that switching to the smooth simple accel code, as an added bonus gives
the tp code an accel profile with a threshold and a speed parameter, which
is exactly what is needed for the upcoming configuration interface support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 27 Jun 2014 02:55:29 +0000 (12:55 +1000)]
Add functions to get the device name, PID and VID
Those three are the ones that matter for logging or device identification in
callers, so let's provide them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Fri, 20 Jun 2014 04:16:13 +0000 (14:16 +1000)]
touchpad: disable tapping for fingers exceeding the timeout/motion threshold
The current code triggers multi-finger tapping even if the finger released was
previously held on the touchpad for a while. For an event sequence of:
1. first finger down
2. first finger move past threshold/wait past timeout
3. second finger down
4. first finger up
The second finger initiates the two-finger tap state, but the button event is
sent when the first finger releases - despite that finger not meeting the
usual tap constraints. This sequence can happen whenever a user swaps fingers.
Add the finger state to the actual touchpoints and update them whenever the
constrains are broken. Then, discard button events if the respective touch
did not meet the conditions.
http://bugs.freedesktop.org/76760
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 30 Jun 2014 12:27:18 +0000 (14:27 +0200)]
touchpad: Simplify tp_hysteresis
Once we get beyond the:
if (abs(diff) <= margin)
return center;
test, then diff is either > margin or < -margin, otherwise the test would
have triggered.
So the "return center + diff;" at the end will never be reached, and the
"else if (diff < -margin)" can be turned into a simple "else".
This commit does not just simplify tp_hysteresis, but (arguably more
important) also makes it clearer to the reader what it does.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Sat, 28 Jun 2014 20:41:29 +0000 (22:41 +0200)]
Fix coding style
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Sat, 28 Jun 2014 20:40:23 +0000 (22:40 +0200)]
test/Makefile.am: Also add LIBUDEV_CFLAGS to AM_CPPFLAGS
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 25 Jun 2014 02:55:58 +0000 (12:55 +1000)]
configure.ac: libinput 0.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 25 Jun 2014 03:37:02 +0000 (13:37 +1000)]
Merge branch 'master' of git+ssh://git.freedesktop.org/git/wayland/libinput
Stephen Chandler Paul [Tue, 24 Jun 2014 22:55:25 +0000 (18:55 -0400)]
touchpad: Fix typo in documentation
"a a left and…"->"a left and…"
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 25 Jun 2014 01:41:16 +0000 (11:41 +1000)]
Drop the deprecated libinput_udev_create_for_seat()
We have enough API breakage in this release that it's not worth keeping
this around. Every caller must be fixed for all the other stuff anyway,
so drop this too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 25 Jun 2014 01:42:35 +0000 (11:42 +1000)]
Fix a few comments referring to udev_create_for_seat()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 25 Jun 2014 01:41:16 +0000 (11:41 +1000)]
Drop the deprecated LIBINPUT_POINTER_*_SCROLL enums
We have enough API breakage in this release that it's not worth keeping
these around. Every caller must be fixed for all the other stuff anyway,
so drop this too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Jun 2014 14:23:13 +0000 (16:23 +0200)]
timer: Complain if a timer is set more than 5 seconds from now
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Jun 2014 14:23:12 +0000 (16:23 +0200)]
test: Prefix litest created device names with litest
And add an example xorg.conf.d .conf file for ignoring these devices under
xorg.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Jun 2014 14:23:11 +0000 (16:23 +0200)]
tp_post_twofinger_scroll: Move setting of t->is_pointer = false up a bit
There is no need to loop over the touch points twice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Jun 2014 14:23:10 +0000 (16:23 +0200)]
touchpad: Avoid spurious motion event for scroll movement below threshold
If the user puts down to fingers to scroll, then changes his mind and
lifts them, without having them moved past the initial scroll threshold in
either direction, then any movement which he has done will cause a spurious
scroll event when the second finger down is lifted first.
The problem is that t->is_pointer was not being set to false in this case,
since that is done in tp_post_twofinger_scroll after checking scroll.state
which never gets set in this scenario.
Instead of changing the order, simply completely remove scroll.state completely
it is a boolean, and everywhere we check for it we also check for the axis bits
in state.direction, so it is not necessary.
Also add a check to ensure there are no spurious motion events.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Jun 2014 14:23:09 +0000 (16:23 +0200)]
test: Add touchpad 2 finger scroll test
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 20 Jun 2014 04:24:57 +0000 (14:24 +1000)]
test: add one more test for two-finger tapping
Inverted order of release from the other test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 20 Jun 2014 04:06:19 +0000 (14:06 +1000)]
Add msleep() helper function
For those whose eyes struggle to focus on 5 zeros in a row, or those just sick
of forgetting one zero and wondering why things don't work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 25 Jun 2014 00:32:42 +0000 (10:32 +1000)]
Merge branch 'ref-counting-context'
Conflicts:
src/udev-seat.c
test/log.c
Jonas Ådahl [Tue, 24 Jun 2014 22:06:59 +0000 (00:06 +0200)]
test: Add context reference counting test
This test relies on valgrind detecting the leak and use-after-free.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Tue, 24 Jun 2014 22:06:58 +0000 (00:06 +0200)]
Make context reference counted
Instead of only allowing one owner keeping a libinput context alive,
make context reference counted, replacing libinput_destroy() with
libinput_unref() while adding another function libinput_ref().
Even though there might not be any current use cases, it doesn't mean we
should hard code this usage model in the API. The old behaviour can be
emulated by never calling libinput_ref() while replacing
libinput_destroy() with libinput_unref().
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Tue, 24 Jun 2014 22:06:57 +0000 (00:06 +0200)]
Make ref count unref/ref() functions return resulting object pointer
In order to know if an unref() destroyed an object and to allow more
convenient use of ref(), make both functions return a pointer to the
object it was passed, or NULL if that object was destroyed.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Mon, 23 Jun 2014 21:32:29 +0000 (23:32 +0200)]
event-gui: Don't drop fraction of pointer motion events
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 18 Jun 2014 09:51:19 +0000 (19:51 +1000)]
Change the logging system to be per-context
Rather than a single global logging function, make the logging dependent on
the individual context. This way we won't stomp on each other's feet in the
(admittedly unusual) case of having multiple libinput contexts.
The userdata argument to the log handler was dropped. The caller has a ref to
the libinput context now, any userdata can be attached to that context
instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 12 Jun 2014 01:44:31 +0000 (11:44 +1000)]
udev: split libinput_udev context init into two functions
This is preparation work for context-specific log handlers.
Callers are now encouraged to first initialize the context with
libinput_udev_create_context() and then set the seat for this context with
libinput_udev_assign_seat().
In the upcoming patch to support context-specific log handlers this enables a
caller to set the log handler for a context before any devices are
initialized. Otherwise, a log message generated by a new device may pass a
libinput context that the caller is not yet aware of.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 13 Jun 2014 01:11:05 +0000 (11:11 +1000)]
test: move the interface declaration up
No functional changes, just some prep work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 16 Jun 2014 21:55:35 +0000 (07:55 +1000)]
Rename KEYBOARD_KEY_STATE to KEY_STATE
e912d620d0f20f415b4d3dde967648e4b9c317b9 changed from POINTER_BUTTON_STATE to
simply BUTTON_STATE, replicate that for key events too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 27 May 2014 05:29:55 +0000 (15:29 +1000)]
tools: add a tool for GUI-based debugging
Looking at debugging output is nice but not useful when testing for the feel
of a device. Add a tool that presents a canvas and draws the various events
onto it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 26 Apr 2014 10:01:22 +0000 (20:01 +1000)]
Name-space the scroll event types
To provide a generic naming system of type_direction. That will become more
important once we add new axes as part of the ongoing work to support graphics
tablets.
[edit: and switch to the new defines]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 17 Jun 2014 05:45:07 +0000 (15:45 +1000)]
Add a function to get the size of a device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 19 Jun 2014 01:30:21 +0000 (11:30 +1000)]
Change absolute and touch events to use mm as default unit
Instead of device-specific coordinates that the caller can't interpret without
knowing the range anyway, return mm as the default value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 19 Jun 2014 01:17:10 +0000 (11:17 +1000)]
evdev: force a resolution of 1 where no resolution is set
Avoids nasty surprises later when we divide by 0. This matters particularly
when testing a device through uinput, which can't set the resolution.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 19 Jun 2014 01:11:36 +0000 (11:11 +1000)]
evdev: keep the absinfo struct around instead of min/max
We'll need that later for conversion to mm.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 18 Jun 2014 12:22:24 +0000 (14:22 +0200)]
touchpad: tp_current_touch: Fix off by one error
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 13 Jun 2014 04:43:28 +0000 (14:43 +1000)]
tools: fix the publish-doc script
Original script was broken, curse those last-minute changes before pushing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 12 Jun 2014 01:55:21 +0000 (11:55 +1000)]
Document the top software button behavior
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 13 Jun 2014 01:37:59 +0000 (11:37 +1000)]
test: fix a path test
Test with the right interface, otherwise checking to make sure we didn't call
open on any device is a bit pointless.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 12 Jun 2014 01:48:13 +0000 (11:48 +1000)]
path: log two errors as application bugs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 12 Jun 2014 01:42:25 +0000 (11:42 +1000)]
doc: ignore LIBINPUT_ATTRIBUTE_PRINTF in doxygen
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 12 Jun 2014 01:12:50 +0000 (11:12 +1000)]
Add two doxygen cross-references for the logging functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 10 Jun 2014 23:39:12 +0000 (09:39 +1000)]
test: add a couple of top software button test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 10 Jun 2014 22:59:11 +0000 (08:59 +1000)]
test: Add description for the T440 synaptics touchpad
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 10 Jun 2014 23:45:07 +0000 (09:45 +1000)]
test: add clickpad software button tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 06:25:37 +0000 (16:25 +1000)]
test: add a bunch of test for click behavior on touchpads
Mainly testing the behaviour when clicking during a tap or tap-n-drag. Adds a
new "feature" to the litest system, Apple clickpads don't have software
buttons by default.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 6 Jun 2014 00:58:11 +0000 (10:58 +1000)]
test: add litest_assert_empty_queue helper function
Checks if the queue is empty and prints informatino about any events before
failing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 06:22:52 +0000 (16:22 +1000)]
touchpad: always call into the the tap state machine
A button event consumed by the softbutton or clickpad code does not feed into
the tap state machine, leaving it in its current state. The touch generating
that event however may have triggered state changes.
For some tap/click combinations this gives us either double press/release
events or an inconsistent order of events. Those issues include:
* a really short physical click causes a click + tap-click
* a really short physical click on the right software button causes a right
click + left tap-click
* tap + click causes double button left press events
To avoid these, notify the tap code that a button event has occured and
process that accordingly. Depending on the state this may either continue to
the DEAD state or release the current tap button and then go to the DEAD
state.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 10 Jun 2014 13:08:03 +0000 (15:08 +0200)]
Add a log_msg_va function
This is useful for when we use libraries which want us to provide them with
a logging callback.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 10 Jun 2014 13:08:04 +0000 (15:08 +0200)]
timer.h: Add #include libinput-util.h
libinput-util.h is needed for the linked list definitions.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 5 Jun 2014 06:04:00 +0000 (16:04 +1000)]
touchpad: Prefix tap-debugging message
For consistency with the butto state debugging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 5 Jun 2014 06:00:17 +0000 (16:00 +1000)]
touchpad: log the invalid event as bug, not just as info
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 10 Jun 2014 22:35:56 +0000 (08:35 +1000)]
test: use check's strcmp API instead of strcmp
Prints out the strings on failure - easier for debugging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 10 Jun 2014 23:00:46 +0000 (09:00 +1000)]
test: drop unused includes for libinput-util.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Fri, 6 Jun 2014 15:01:07 +0000 (17:01 +0200)]
evdev-mt-touchpad-tap: Switch over to new timer subsystem
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Fri, 6 Jun 2014 15:01:06 +0000 (17:01 +0200)]
evdev-mt-touchpad-buttons: Switch over to new timer subsystem
Besides being a nice cleanup, this gives us proper per touch timeouts.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Fri, 6 Jun 2014 15:01:05 +0000 (17:01 +0200)]
Add a timer subsystem
Currently we are using DIY timers in the touchpad softbutton and tap handling
code, and at least the softbutton code gets its wrong. It uses one timer-fd
per touchpad to set a timeout per touch, which means that if a timeout is
set for 100ms from now for touch 1, and then 50 ms later touch 2 sets a timeout
for 200 ms from now, then the timeout for touch 1 will come 150 ms too late.
This commits adds a proper timer subsystem so that we've one place to deal
with timer handling, and so that we can only get it wrong (well hopefully
we get it right) in one place.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 6 Jun 2014 05:56:50 +0000 (15:56 +1000)]
Mark the log function as attribute printf
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 6 Jun 2014 05:55:15 +0000 (15:55 +1000)]
test: add --verbose flag to litests
Sometimes it's handy to see what libinput prints out while running a test.
This breaks test-log if run with --verbose. Checking that the default log
priority hasn't changed obviously doesn't work if we change it on demand.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 6 Jun 2014 04:58:14 +0000 (14:58 +1000)]
test: drop TEST_CFLAGS
We're using the same flags for everything anyway, drop the custom flags
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 23:38:35 +0000 (09:38 +1000)]
test: silence compiler warning for C++ build test
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
C/ObjC but not for C++ [enabled by default]
Since gcc also complains about adding -Wno-strict-prototypes we have to handle
the two separately. A side-effect here: now that we promote the GCC_CFLAGS to
AM_CFLAGS, litest.la is built with the correct CFLAGS too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 23:48:00 +0000 (09:48 +1000)]
test: fix compiler warnings for missing field initializers
litest-trackpoint.c:38:1: warning: missing initializer for field 'touch_down'
of 'struct litest_device_interface' [-Wmissing-field-initializers]
and similar
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 23:47:05 +0000 (09:47 +1000)]
test: fix compiler warnings for missing prototypes
litest-wacom-touch.c:31:6: warning: no previous prototype for
'litest_wacom_touch_setup' [-Wmissing-prototypes]
and similar
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 23:44:43 +0000 (09:44 +1000)]
test: fix compiler warning for is_debugger_attached
litest.c:207:1: warning: function declaration isn't a prototype
[-Wstrict-prototypes]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 6 Jun 2014 04:53:40 +0000 (14:53 +1000)]
Drop empty FFI_CFLAGS
Leftover from weston
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 5 Jun 2014 05:42:49 +0000 (15:42 +1000)]
tools: add a script to push the doxygen output to freedesktop.org
Intentionally not added to EXTRA_DIST, if you're not running libinput from git
you're not supposed to push documentation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Mon, 9 Jun 2014 21:39:06 +0000 (23:39 +0200)]
doc: Fix spelling
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Thu, 5 Jun 2014 07:34:19 +0000 (09:34 +0200)]
configure.ac: libinput 0.3
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Mon, 9 Jun 2014 20:26:22 +0000 (22:26 +0200)]
evdev: Migrate rest of 32 bit time variables to uint64_t
Makes tests pass again with long uptime.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Stephen Chandler Paul [Wed, 4 Jun 2014 00:08:02 +0000 (20:08 -0400)]
s/libinput_pointer_button_state/libinput_button_state/
Button states are applicable to more then just the pointer, so having a
non-generic name name for a generic enumerator value like
libinput_pointer_button_state doesn't make sense. Changing it to something
generic like libinput_button_state allows it to be reused by other devices that
may potentially be added to libinput in the future.
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Mon, 2 Jun 2014 21:09:27 +0000 (23:09 +0200)]
Use floating point numbers instead of fixed point numbers
Fixed point numbers can easily overflow, and double to fixed point
conversion is lossy. Use floating point (double) where fixed point
numbers where previously used and remove the li_fixed_t type.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 4 Jun 2014 21:56:39 +0000 (07:56 +1000)]
touchpad: whitespace fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 23 May 2014 14:06:26 +0000 (16:06 +0200)]
touchpad: Drop the scroll direction lock, increase threshold instead
The direction lock was intended to avoid erroneous horizontal scroll events
when scrolling vertically (and vice versa). Some testing on my touchpad here
shows that it is too easy to accidentally lock the direction when no lock is
intended (e.g. moving around an image). And quite hard to figure out what a
pure vertical gesture is.
I get movements from 90 degrees to 70 degrees for something my brain would
consider vertical scrolling. Depending on the hand position, the fingers
actually perform a slight curve, not a straight line.
Hence - drop the direction lock, but increase the threshold a little. It
doesn't totally avoid horizontal scroll events but keeps them minimal.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 4 Jun 2014 01:27:08 +0000 (11:27 +1000)]
touchpad: break up a long line
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 2 Jun 2014 21:51:37 +0000 (07:51 +1000)]
Add our own version of linux/input.h
Avoids having to #define any values we're trying to use.
Header file is from Linux 3.15-rc8.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Mon, 2 Jun 2014 22:25:37 +0000 (08:25 +1000)]
test: fix resolution on all devices
struct input_absinfo has the resolution as the 6th field, not as the 4th.
This doesn't have any visible effect because uinput doesn't allow us to set
the resolution yet.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 2 Jun 2014 22:23:48 +0000 (08:23 +1000)]
test: fix resolution on Wacom ISDv4 E6 Finger device
Resolution for x is 10, 9 for y. And while we're at it set the actual
resolution, not the fuzz.
No actual effect since resolution can't be set through uinput where we use
these devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 2 Jun 2014 22:00:00 +0000 (08:00 +1000)]
tools: fix a compiler warning
event-debug.c: At top level:
event-debug.c:129:1: warning: ‘static’ is not at beginning of declaration
[-Wold-style-declaration]
const static struct libinput_interface interface = {
^
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 2 Jun 2014 06:43:42 +0000 (16:43 +1000)]
test: fix a bunch of "unused variable" warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 2 Jun 2014 06:18:30 +0000 (16:18 +1000)]
test: use the TEST_CFLAGS for all tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 2 Jun 2014 06:18:10 +0000 (16:18 +1000)]
test: compiler warning fixes
misc.c: In function ‘create_simple_test_device’:
misc.c:71:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while ((type = va_arg(args, unsigned int)) != -1 &&
^
misc.c:72:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(code = va_arg(args, unsigned int)) != -1) {
Peter Korsgaard [Mon, 2 Jun 2014 21:11:31 +0000 (23:11 +0200)]
evdev: Provide fallback definition for KEY_MICMUTE
KEY_MICMUTE was added relatively recently (3.1 with
33009557bd: Add
KEY_MICMUTE and enable it on Lenovo X220), so provide a fallback definition
similar to how we do it for KEY_LIGHTS_TOGGLE to fix compilation with older
toolchains.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Peter Korsgaard [Mon, 2 Jun 2014 21:11:30 +0000 (23:11 +0200)]
evdev: Use correct fallback value for KEY_LIGHTS_TOGGLE
The kernel defines KEY_LIGHTS_TOGGLE as 0x21e, not 0x160 (which is KEY_OK).
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Peter Hutterer [Mon, 2 Jun 2014 03:44:59 +0000 (13:44 +1000)]
touchpad: fix two indentation issues in the header
7 whitespace -> tab
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 27 May 2014 13:08:35 +0000 (15:08 +0200)]
touchpad: Add support for top softbutton area
Add support for the top softbutton area found on some laptops.
For details of how this works, see the updated
doc/touchpad-softbutton-state-machine.svg diagram.
Basically this mirrors the state-machine for the bottom softbutton area, with
one exception, if a finger stays at least inner timeout milliseconds in the
top button area and then moves out of it, it will be ignored rather then
become the pointer. This is done so that people using the top buttons together
with a trackstick and accidentally move their finger out of the upper area
don't get spurious pointer movements from the finger on the trackpad.
This behavior is indentical to xf86-input-synaptics, which also ignores
movements from touches which start in the top button area.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 27 May 2014 13:17:26 +0000 (15:17 +0200)]
touchpad: Rename some variables and functions
Rename some clickpad softbutton area variables to have bottom in their
name, this is a preperation patch for adding top softbutton area support.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 30 May 2014 04:41:23 +0000 (14:41 +1000)]
tools: add explicit libudev dependency to event-debug
The header is pulled in by libinput.h, the libs by libinput but make this
explicit.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 27 May 2014 03:47:58 +0000 (13:47 +1000)]
configure: simplify a condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 21 May 2014 04:36:01 +0000 (14:36 +1000)]
Replace log_bug with per-component bug macros
When we knowingly hit a bug, we should know what the bug is caused by. Log
that in a standardized fashion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 23 May 2014 04:10:57 +0000 (14:10 +1000)]
test: disable CK_FORK for the valgrind runs
I'm not sure what exactly is happening here, but while valgrind seems to run
fine in normal mode, the build from make distcheck fails with rather random
errors. Disabling CK_FORK seems to help, but more investigation is needed.
Meanwhile, this makes distcheck succeed again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 23 May 2014 04:13:39 +0000 (14:13 +1000)]
test: restore log priority after each test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>