Stephen Chandler Paul [Mon, 5 Jan 2015 22:44:37 +0000 (17:44 -0500)]
libinput.h: Fix some line wrapping in documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Marek Chalupa [Fri, 9 Jan 2015 09:34:46 +0000 (10:34 +0100)]
build-pedantic: use main(void)
Main has unused parameters argc and argv. Since they are unused and
C 99 allows to prototype main as 'int main(void)',
remove them and replace by void. It fixes build when unused parameters
are treated as errors.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 7 Jan 2015 04:32:16 +0000 (14:32 +1000)]
tools: switch signal handler in event-debug
Under gdb, signalfd will still deliver the signal when gdb itself is
interrupted and quit event-debug. For a debugging tool, that's not optimal.
Switch to a normal signal handler instead, signalfd is overkill here anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 7 Jan 2015 04:09:00 +0000 (14:09 +1000)]
tools: fail if we can't set up signal handlers in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Wed, 7 Jan 2015 04:10:28 +0000 (12:10 +0800)]
Dropped an extra 'the'
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Jonas Ådahl [Wed, 7 Jan 2015 04:03:53 +0000 (12:03 +0800)]
s/discreet/discrete/
Discreet means to not draw attention.
Discrete means non-continuous.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 5 Jan 2015 23:34:06 +0000 (09:34 +1000)]
touchpad: fix a clang compiler warning
Causes the valgrind tests to fail as tp is considered uninitialized.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 5 Jan 2015 22:49:11 +0000 (08:49 +1000)]
test: fix a clang compiler warning
misc.c:562:10: warning: missing field 'expected_dpi' initializer
[-Wmissing-field-initializers]
{ NULL }
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 5 Jan 2015 22:52:49 +0000 (08:52 +1000)]
test: drop empty test device interfaces
We can just set the interface component to NULL directly instead. Fixes clang
warnings:
litest-mouse.c:38:1: warning: missing field 'touch_move' initializer
[-Wmissing-field-initializers]
litest-trackpoint.c:38:1: warning: missing field 'touch_move' initializer
[-Wmissing-field-initializers]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 5 Jan 2015 22:50:03 +0000 (08:50 +1000)]
Drop unused function calc_penumbral_gradient
Unused since
4913fd7a4806e54ebe4eb7f5f3f1d2fa3b8fdbdb
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Dec 2014 01:12:41 +0000 (11:12 +1000)]
Minor documentation wording improvement
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 4 Jan 2015 22:36:00 +0000 (08:36 +1000)]
tools: print device capabilities in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 4 Jan 2015 22:40:35 +0000 (08:40 +1000)]
tools: change name/seat/logical seat format string
Change the seat field widths to match the usual seat0/default. This compresses
the output a bit, we're printing too much already.
Also, one of my mice has >30 chars, it's annoying to look at. Fix this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Nov 2014 06:22:07 +0000 (16:22 +1000)]
Add pointer axis sources to the API
For a caller to implement/provide kinetic scrolling ("inertial scrolling",
"fling scrolling"), it needs to know how the scrolling motion was implemented,
and what to expect in the future. Add this information to the pointer axis
event.
The three scroll sources we have are:
* wheels: scrolling is in discreet steps, you don't know when it ends, the
wheel will just stop sending events
* fingers: scrolling is continuous coordinate space, we know when it stops and
we can tell the caller
* continuous: scrolling is in continuous coordinate space but we may or may not
know when it stops. if scroll lock is used, the device may never technically
get out of scroll mode even if it doesn't send events at any given moment
Use case: trackpoint/trackball scroll emulation on button press
The stop event is now codified in the API documentation, so callers can use
that for kinetic scrolling. libinput does not implement kinetic scrolling
itself.
Not covered by this patch:
* The wheel event is currently defined as "typical mouse wheel step", this is
different to Qt where the step value is 1/8 of a degree. Some better
definition here may help.
* It is unclear how an absolute device would map into relative motion if the
device itself is not controlling absolute motion.
* For diagonal scrolling, the vertical/horizontal terminator events would come
in separately. The caller would have to deal with that somehow.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Original patch, before the rebase onto today's master:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 24 Dec 2014 00:16:12 +0000 (10:16 +1000)]
test: add edge-scrolling tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 23 Dec 2014 03:37:28 +0000 (13:37 +1000)]
Add libinput_set_user_data
Previously, the pointer could only be passed into the context on creation
time and was immutable after that.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 04:18:53 +0000 (14:18 +1000)]
Declare libinput.sym as dependency
We want to rebuild whenever it changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 00:37:38 +0000 (10:37 +1000)]
touchpad: revert to pointer movement when stopping twofinger scrolling
Add a boolean state machine for two-finger scrolling so we know when we're
currently scrolling. If we were scrolling and it stops, pick the active
touch as pointer touch so we can go back to pointer movement without having to
lift the finger off the touchpad.
https://bugs.freedesktop.org/show_bug.cgi?id=86807
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 00:21:48 +0000 (10:21 +1000)]
touchpad: rename scroll.state to scroll.edge_state
In preparation for a twofinger_state field, to avoid confusion.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 01:52:31 +0000 (11:52 +1000)]
test: switch tests to use the new helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 01:29:32 +0000 (11:29 +1000)]
test: add helper function for checking for a specific event type
In a few tests we care about that a specific set of events are in the queue
but not about the details of the events (usually checked elsewhere). Instead
of manual loops, provide a helper function that also checks that there is at
least one of those events in the queue.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 03:52:36 +0000 (13:52 +1000)]
test: switch touch points around for semi-mt tap-n-drag testing
The tests ignored it when motion events never happened - but that's mostly
what these tests are about. This only happened for semi-mt devices that use
the bounding box only, not separate touch points. Switching the touch points
around that the bounding box doesn't interfere causes the test to work as
expected.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 23 Dec 2014 01:13:33 +0000 (11:13 +1000)]
tools: pass the userdata to the context
The event-gui needs this but it got dropped in
6ee8c585, causing a crash. Oops.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 04:47:54 +0000 (14:47 +1000)]
tools: use the new shared lib from event-gui
This gives the event gui the ability to use the path backend, and any
configuration toggles given on the commandline.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 05:14:09 +0000 (15:14 +1000)]
tools: add support for enabling/disabling left-handed button mappings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 05:10:59 +0000 (15:10 +1000)]
tools: add support to enable/disable natural scrolling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 05:10:09 +0000 (15:10 +1000)]
tools: move applying device configuration to shared lib
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 05:02:45 +0000 (15:02 +1000)]
tools: move opening the backend to the shared lib too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 04:42:42 +0000 (14:42 +1000)]
tools: move option parsing to a helper library
event-debug and event-gui can and should share this
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 03:04:50 +0000 (13:04 +1000)]
tools: add --enable-tap to event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 02:56:14 +0000 (12:56 +1000)]
tools: make event-debug's option parsing more flexible
We need to be able to turn config options on/off for testing, so switch to
something that's a bit more flexible than characters that represent the
options.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 23:47:39 +0000 (09:47 +1000)]
doc: move the wiki's palm detection docs to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 23:32:37 +0000 (09:32 +1000)]
doc: move the wiki's tapping documentation to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 23:24:33 +0000 (09:24 +1000)]
doc: move the wiki's scrolling documentation to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 22:15:00 +0000 (08:15 +1000)]
doc: add link to udev hwdb in rel motion normalization doc
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 02:11:46 +0000 (12:11 +1000)]
doc: document the calibration as well
Requires MathJax for client-side, but that's an easy dependency to accept and
better than requiring Latex to build the documentation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 00:33:55 +0000 (10:33 +1000)]
doc: improve seat documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 00:11:09 +0000 (10:11 +1000)]
doc: move "device configuration via udev" page to here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 00:09:27 +0000 (10:09 +1000)]
doc: drop touchpad button behavior page - provided in doc/ now
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 00:08:13 +0000 (10:08 +1000)]
doc: move relative motion normalization page over to doc/
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Dec 2014 00:04:58 +0000 (10:04 +1000)]
Improve the documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Thu, 18 Dec 2014 18:49:59 +0000 (10:49 -0800)]
Added configure option for documentation build.
Added option with fallback of 'auto' to control building of documentation.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Thu, 18 Dec 2014 18:49:58 +0000 (10:49 -0800)]
Initial move of some wiki contents into main documentation.
This moves some information from the wiki into the main generated doxygen
documenation. It is fairly rought but includes examples for inline and
stand-alone diagrams, linking to external HTML pages, etc.
Among other things, it allows for better cross-referencing into the
main doxygen contents and thus for overall shorter documentation.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 02:57:59 +0000 (12:57 +1000)]
tools: add --help to event-debug's usage
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Dec 2014 01:55:17 +0000 (11:55 +1000)]
test: fix busted indentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 9 Dec 2014 11:47:11 +0000 (12:47 +0100)]
touchpad: Use TOUCHPAD_MIN_SAMPLES in tp_get_delta
Use TOUCHPAD_MIN_SAMPLES in tp_get_delta rather then hardcoding "4".
Also remove the superfluous TOUCHPAD_MIN_SAMPLES check before calling
tp_get_delta in tp_get_pointer_delta, this is not necessary as tp_get_delta
already checks itself.
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, 9 Dec 2014 11:47:10 +0000 (12:47 +0100)]
touchpad: When a clickpad is clicked post combined motion of all touches
When clicking a clickpad the user may want to switch fingers to move the
pointer around, without lifting so as to not release the button.
Switch to using combined motion of all touches when a clickpad is clicked to
allow this.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86807
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, 9 Dec 2014 11:47:09 +0000 (12:47 +0100)]
touchpad: Add a tp_post_pointer_motion helper function
Split out the pointer-motion handling into a helper function.
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, 12 Dec 2014 01:21:05 +0000 (11:21 +1000)]
touchpad: print event type on state machine error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 12 Dec 2014 01:13:21 +0000 (11:13 +1000)]
touchpad: fix typos in error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 11 Dec 2014 06:30:03 +0000 (16:30 +1000)]
test: fix two compiler warnings
device.c:596:2: warning: incompatible pointer to integer conversion
initializing 'intmax_t' (aka 'long') with an expression of type 'struct
libinput_device *' [-Wint-conversion]
ck_assert_int_eq(libinput_event_get_device(event),
use ck_assert_ptr_eq() instead
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 11 Dec 2014 04:11:27 +0000 (14:11 +1000)]
test: print axis event information for debugging too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 11 Dec 2014 04:02:37 +0000 (14:02 +1000)]
test: print the string of the event type
Bit quicker to parse than the number
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Dec 2014 03:52:45 +0000 (13:52 +1000)]
doc: put some extra warning in for libinput_event_destroy()
Unlike all other structs, events aren't refcounted and will get destroyed
immediately.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 9 Dec 2014 03:37:04 +0000 (13:37 +1000)]
doc: document the base structures so they show up in doxygen
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 9 Dec 2014 03:31:09 +0000 (13:31 +1000)]
doc: add the various events to the doxygen groups
Makes them show up on the respective page and in the data structures list
doxygen generates.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 9 Dec 2014 03:19:54 +0000 (13:19 +1000)]
doc: include README as mainpage
doxygen supports markdown so we can expand the README with general interesting
information in markdown format and have it be the front page of the
documentation at the same time.
This requires renaming README to README.txt, but that's a relatively small
price to pay.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 9 Dec 2014 02:52:45 +0000 (12:52 +1000)]
Use symbol versioning
This isn't the final 0.8.0 API yet, but we might as well get started.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 9 Dec 2014 02:55:17 +0000 (12:55 +1000)]
Drop deprecated symbols
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 10 Dec 2014 01:01:08 +0000 (11:01 +1000)]
test: create a new device during the disable test to change fds
In the current test, disable followed by enable would result in the same fd
number for the new device, not exposing a bug fixed by
"evdev: Ensure the libevdev object receives the new fd on resume"
Create a keyboard device after suspending the first device, then re-enable the
device. This changes the fd to a different number, so we pick up on internal
bugs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Carlos Garnacho [Tue, 9 Dec 2014 14:55:32 +0000 (15:55 +0100)]
evdev: Ensure the libevdev object receives the new fd on resume
Otherwise, input_events will be attempted to read from the wrong place,
which also leaves the right/current fd with pending data to be read,
making the epoll fd wake up constantly.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Fri, 5 Dec 2014 11:50:39 +0000 (12:50 +0100)]
touchpad: Use remove callback to unlink event listener and stop timers
We use 2 mechanisms to unregister the trackpoint event listener depending on
device removal order.
1) We have a device_removed callback, if the trackpoint gets removed before
the touchpad, this gets called, sees the device being removed is the trackpoint
and unregisters the listener
2) If the touchpad gets removed first, then in tp_destroy we unregister the
listener
2) May be delayed beyond the destruction of the trackpoint itself if the
libinput user has a reference to the libinput_device for the touchpad.
When this happens the trackpoint still has an eventlistener at destroy time
and an assert triggers.
To fix this we must do 2) at the same time as we do 1), so at remove time.
While working on this I noticed that the touchpad code was also cancelling
timers at destroy time rather then remove time, which means that they may
expire between remove and destroy time, and cause events to be emitted from
a removed device, so this commit moves the cancelling of the timers to the
remove callback as well.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Fri, 5 Dec 2014 11:39:16 +0000 (12:39 +0100)]
evdev: Add a remove callback to the evdev_dispatch_interface
Some dispatchers may want to do some cleanup at remove time, rather then at
destroy time.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Dec 2014 02:58:04 +0000 (12:58 +1000)]
README: link to bugzilla and API docs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Dec 2014 03:42:45 +0000 (13:42 +1000)]
doc: fix wording on the dpi normalization paragraph
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Dec 2014 03:56:02 +0000 (13:56 +1000)]
doc: delete double-empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Carlos Garnacho [Mon, 8 Dec 2014 09:46:54 +0000 (10:46 +0100)]
evdev: Remove double-semicolon
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 5 Dec 2014 02:08:22 +0000 (12:08 +1000)]
configure.ac: libinput 0.7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 5 Dec 2014 03:41:04 +0000 (13:41 +1000)]
udev: only apply default calibration on absolute devices
Fixes a crash if the LIBINPUT_CALIBRATION_MATRIX is set for a relative device.
https://bugs.freedesktop.org/show_bug.cgi?id=86993
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Fri, 5 Dec 2014 02:52:22 +0000 (12:52 +1000)]
Split libinput-util into a noinst helper library
Fixes distcheck (automake 1.14.1)
make[2]: Entering directory '....../libinput-0.7.0/_build/test'
Makefile:926: ../src/.deps/libinput-util.Plo: No such file or directory
make[2]: *** No rule to make target '../src/.deps/libinput-util.Plo'. Stop.
make[2]: Leaving directory '....../libinput/libinput-0.7.0/_build/test'
Makefile:412: recipe for target 'distclean-recursive' failed
That was the only place we used subdir objects, so we can drop it from
configure now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Thu, 4 Dec 2014 03:44:10 +0000 (11:44 +0800)]
test: Don't send two motion events when button scrolling
Button scrolling motion events don't pass through the acceleration
filter so no need to assume the initial event will be absorbed.
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 [Thu, 4 Dec 2014 03:44:09 +0000 (11:44 +0800)]
Introduce unaccelerated motion event vectors
For certain applications (such as FPS games) it is necessary to use
unaccelerated motion events (the motion vector that is passed to the
acceleration filter) to get a more natural feeling. Supply this
information by passing both accelerated and unaccelerated motion
vectors to the existing motion event.
Note that the unaccelerated motion event is not equivalent to 'raw'
events as read from devices.
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>
Peter Hutterer [Thu, 4 Dec 2014 06:50:32 +0000 (16:50 +1000)]
Always check for INVALID configs first
Always check for invalid input first, then check if the input is supported by
the actual device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Dec 2014 01:08:01 +0000 (11:08 +1000)]
touchpad: drop unused device arg from tp_clear_state
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Dec 2014 04:28:12 +0000 (14:28 +1000)]
Add missing @ingroup tag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Dec 2014 01:57:35 +0000 (11:57 +1000)]
Document relative motion normalization
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Dec 2014 06:00:13 +0000 (16:00 +1000)]
Add libinput_device_get_context/libinput_seat_get_context
Allow retrieval of the libinput context from the seat and the device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 31 Oct 2014 00:53:53 +0000 (10:53 +1000)]
Add a function to retrieve the udev_device handle from a libinput device
The libinput device abstracts a number of things but sometimes the underlying
device is important. The udev device provides the necessary handle to access
that underlying device and various sysfs properties that may be necessary.
A function returning the device node would've done the same thing but is more
prone to race conditions than the udev_device.
https://bugs.freedesktop.org/show_bug.cgi?id=85573
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 28 Nov 2014 00:09:21 +0000 (10:09 +1000)]
Change default DPI to 1000
400 used to be the default DPI for many mice but it it's not anymore. A survey
of mice shows that 400 is still common as one of the pre-configured settings
in switchable multi-resolution gaming mice, but devices with a single
resolution mostly favor 1000 dpi.
Let's make that switch now so that any future changes to the pointer
acceleration code assumes that resolution as a default.
For the touchpad, this has a bad side-effect, caused by our expectation of
mouse vs touchpad behaviours: our acceleration code ignores device type and
provides the same acceleration for the same physical movement. Unfortunately,
we expect touchpads to be significantly slower than mice.
The previous 400 DPI worked because it caused an acceptable slowdown on input.
e.g. on the T440 with a res of 42 units/mm, the scale coefficient was 0.37.
For 1000 DPI as default, this now results in 0.94, i.e. speeding up the
touchpad by a factor of 2.5. That is way too fast.
Adding touchpad-specific filter code is a bigger project, so let's just add a
fixme for now and scale the coefficient back to what it was before the
DPI default change. Effect: touchpad behaves as before.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 28 Nov 2014 00:08:02 +0000 (10:08 +1000)]
Move DEFAULT_MOUSE_DPI to filter.h
The filter code is what relies on some default dpi configuration to apply
pointer acceleration and expects the input coordinates to be pre-scaled to
that resolution.
Let's move the define here so we can use it from the touchpad code too.
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 28 Nov 2014 00:00:30 +0000 (10:00 +1000)]
filter: fix a comment, 400 isn't hard-coded anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Derek Foreman [Tue, 25 Nov 2014 17:46:42 +0000 (11:46 -0600)]
evdev: Query mouse DPI from udev
Instead of using a hard coded mouse DPI value, we query it from udev.
If it's not present or the property is obviously broken we fall back
to default.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 1 Dec 2014 03:21:26 +0000 (13:21 +1000)]
test: move device ID test to test/device.c
More appropriate here, they were in misc because this file didn't exist yet
when they were added.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Derek Foreman [Tue, 25 Nov 2014 17:53:23 +0000 (11:53 -0600)]
evdev: Fix uninitialized variable warning
The early exit path in evdev_device_compare_syspath() expects
udev_device_new to be initialized to NULL, but it wasn't.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Krzysztof A. Sobiecki [Tue, 25 Nov 2014 01:33:53 +0000 (02:33 +0100)]
Ignore devices that have joystick buttons
This patch allows libinput to ignore devices that have joystick buttons.
Signed-off-by: Krzysztof Sobiecki <sobkas@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Mon, 24 Nov 2014 11:16:06 +0000 (12:16 +0100)]
touchpad: Add edge-scrolling support
Add edge-scrolling support for non multi-touch touchpads as well as for
users who prefer edge-scrolling (as long as they don't have a clickpad).
Note the percentage to use of the width / height as scroll-edge differs from
one manufacturer to the next, the various per model percentages were taken
from xf86-input-synaptics.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=85635
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 [Mon, 24 Nov 2014 11:16:05 +0000 (12:16 +0100)]
touchpad: Add code to get the touchpad model / manufacturer
This is useful to know in some cases, it is e.g. necessary to figure out
which percentage of a touchpads range to use as edge for edge-scrolling.
Note this is a slightly cleaned up copy of the same code in
xf86-input-synaptics.
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 [Mon, 24 Nov 2014 11:16:04 +0000 (12:16 +0100)]
touchpad: Move 2 finger scrolling functions to above tp_process_state()
This is purely a code move, this is a preparation patch for adding edge
scrolling 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 [Wed, 19 Nov 2014 05:42:54 +0000 (15:42 +1000)]
test: add seat changing tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Nov 2014 03:43:59 +0000 (13:43 +1000)]
Add libinput_device_set_seat_logical_name() to change seats at runtime
The seat of a device is currently immutable, but a device may (in a
multi-pointer case) move between different logical seats. Moving it between
seats is akin to removing it and re-plugging it, so let's do exactly that.
The physical seat name stays immutable.
Pro:
- device handling after changing a seat remains identical as handling any
other device.
Con:
- tracking a device across seat changes is difficult
- this is not an atomic operation, if re-adding the device fails it stays
removed from the original seat and is now dead
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Nov 2014 04:16:48 +0000 (14:16 +1000)]
path: optionally pass the seat name into path_device_enable()
Prep work for changing seat names on devices. No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Nov 2014 04:12:16 +0000 (14:12 +1000)]
udev: optionally pass the seat name into device_added()
Prep work for changing seat names on devices. No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 21 Nov 2014 06:18:57 +0000 (16:18 +1000)]
evdev: remove a race condition opening the wrong device
Potential race condition:
- udev notifies us that a udev_device became available
- we go for a coffee and chat to the neighbours on the way
- the device is unplugged
- a new device is plugged in, gets the same devnode
- we finish our coffee and come back
- open(udev_device_get_devnode())
- new device is now opened as the old device
To avoid the above race, we compare the syspath of the device at the open fd
with the syspath of the device we originally wanted. If they differ, we fail.
evdev_compare_syspath was simply moved up.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 20 Nov 2014 03:55:48 +0000 (13:55 +1000)]
evdev: use a udev_device instead of separate sysname/syspath/devnode
Using a udev_device instead of the various bits separately safes us
re-initializing udev contexts whenever we need to compare the device. And
having the actual udev device makes it a bit easier to ensure that we're not
re-initializing a different device as a current one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 20 Nov 2014 03:50:57 +0000 (13:50 +1000)]
path: store the udev device instead of just the devnode
Long-term plan to use more of udev_device here is to better protect us against
re-opening a different device that happens to have the same devnode.
This now also prints an error message for invalid devices, the log tests are
adjusted.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Nov 2014 05:26:40 +0000 (15:26 +1000)]
path: split out creating a device into a helper function
No functional changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 20 Nov 2014 03:36:32 +0000 (13:36 +1000)]
path: keep the udev context around
We need it for each device anyway, keep the ref around. Makes error handling a
bit easier, we don't need to handle failing udev_new() and reduce the danger
of mis-refcounting it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Nov 2014 02:16:28 +0000 (12:16 +1000)]
Rename scroll_mode to scroll_method
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 21 Nov 2014 06:20:42 +0000 (16:20 +1000)]
evdev: fix leaking file descriptor
If zalloc fails, we need to close the fd.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 20 Nov 2014 02:08:22 +0000 (12:08 +1000)]
Drop unused libinput_device->terminated field
Unused since commit 56f7dde "Port udev-seat to be used in libinput"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>