SynapticsHwStruct (SHS) will soon include ValuatorMasks, which can only
be allocated on the heap. The input driver callbacks are called in
signal context, so we can't instantiate a new SHS when that occurs.
Since we only ever need one SHS, allocate one at device init time and
use it in place of local SHS instances.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Provide a helper function for allocating proto data and use it in
eventcomm-test. This ensures a null pointer for priv->proto_data is not
dereferenced.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The algorithm is completely wrong because it uses subtraction of
unsigned variables. The negative effects of this commit manifest in
cursor warps to edges or corners of the screen.
Since the algorithm has never worked right, previous testing must be
disregarded. Revert it until we have a tested algorithm.
This reverts commit b26125e412.
Conflicts:
src/synaptics.c
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
For devices with only x/y, num_mt_axes is 0, since x/y are already counted
elsewhere. The server will then fail to init the TouchClassRec since it
expects at least 2 touch axes. Fix this, assume we always have at least two
touch axes if we have any touch axes at all.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
When a second touch begins, emit a touch begin for the first touch with
the current valuator values. When a touch ends and we are going from two
touches down to one touch, end both touches. This ensures we don't send
a touch sequence at the same time we are moving the pointer.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
num_mt_axes contains the number of non-x/y multitouch axes, and the valuator
mask needs to contains x, y, followed by two empy values for the scroll
valuators, followed by the remaining MT axes.
https://bugs.freedesktop.org/show_bug.cgi?id=45663
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Otherwise, we might post motion events and touch events for the same
physical interaction.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
I have seen this a couple times, but I haven't been able to catch it
when it starts. It's a feedback loop, so once you miss the entrance of
the loop, you can't see what really went wrong.
This patch papers over the issue for now.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synaptics.c: In function 'DeviceInit':
synaptics.c:1161:18: warning: unused variable 'atom' [-Wunused-variable]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fixes a compiler warning due to discarding the const qualifier as it
comes back from the option code.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synaptics.c: In function 'SynapticsAccelerationProfile':
synaptics.c:619:12: warning: unused variable 'thr' [-Wunused-variable]
On input ABIs < 14.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit reverts 13543b156d
As seen in Debian's #648488, this switch causes a regression on
PowerPC, especially seen on iBook G4 with appletouch. Take a defensive
stance and revert back to a working state until things have been figured
out and fixed properly.
Since things have evolved and since that revert triggers a lot of
conflicts, the following method was applied:
- manual reintroduction of the 3 removed macros: OFF, LONG, TEST_BIT
- coccinelle semantic patch to revert from BitIsOn to TEST_BIT
Coccinelle semantic patch:
@@
expression a,b;
@@
-BitIsOn(a,b)
+TEST_BIT(b,a)
Bugzilla: http://bugs.debian.org/648488
Signed-off-by: Cyril Brulebois <kibi@debian.org>
The remainder of the handling code will take try through all protocols,
taking the device into account (as of
xf86-input-synaptics-1.4.0-34-g241254e)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Instead of requiring the caller to know which private field indicates
failure, just return true on success or false on failure.
No functional change.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
XI2.1 allows an 'increment' for each scrolling variable. Use that instead of
hiding it away inside the driver.
For circular scrolling, the increment is the one of the respective scrolling
axis.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Post smooth-scrolling events through the new X server API when
available, rather than legacy jerky button events.
[Amended to use the final smooth scrolling API]
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Amendments-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synaptics.c: In function 'post_scroll_events':
synaptics.c:2426:26: warning: unused variable 'para' [-Wunused-variable]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Convert ScrollData from up/down/left/right members for button presses,
to more fine-grained delta_x and delta_y members, and move these to
priv->scroll.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
ABI 13 still uses pointer as type for most option calls, ABI 14 uses the
proper type now. Wrap this so we can build against both versions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The code was checking for a value of exactly 1, while the Synaptics
docs at http://www.synaptics.com/sites/default/files/511-000275-01rA.pdf
say:
Extended Model ID. This query returns the product ID, additional
capability bits, and additional bits to widen the infoSensor
field. infoSensor is a part of the Model ID query (query $03).
The Extended Model ID query is only present if nExtendedQueries
is *greater than* or equal to 1.
Signed-off-by: Casper Dik <casper.dik@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If all we see is a PS/2 Mouse or similar, then the kernel doesn't give us
the required bits to provide all the functionality we want. Note that in the
man-page.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
repeat_scrollbuttons used to read the scroll repeat values and then post
button events directly. Instead, make it modify ScrollData and let
post_scroll_events take care of sending the scroll events, which
requires moving the repeat_scrollbuttons call upwards.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Also rename (e.g. autoscroll_x -> coast_delta_x, and
autoscroll_xspd -> coast_speed_x) variables to clarify things a bit.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Stopping a little short of having a full scroll history, adding
last_millis lets us track when the last scroll event we sent was,
for more accurate timing of coasting in particular.
Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
And rename them to last_x, last_y and last_a respectively, as they're
used to store the values as of the last scroll event sent.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Instead of a combined variable declaration with two ternary expressions
using raw hex values, expand it to have two genuine if statements,
setting with a more clear bitshift.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Make the palm-check logic more stable and reliable, and make sure that
any palms are blocked for the duration of their presses.
Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Use better time estimates so we can provide better fake motion events.
This reduces the difference between motion with one and two fingers down
to be almost imperceptible, despite the reporting rate being halved on
PS/2 devices.
Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Use a smarter motion estimator that attempts to draw a best-fit line
through the history where possible, including taking acceleration into
account.
Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
Seems more sensible to update the count of packets in the history when
we update the history, rather than somewhere else entirely.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>