Commit Graph

108 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
8bfd4dcbd8 drop obsolete #ifdef HAVE_CONFIG_H
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-17 19:06:58 +01:00
Alan Coopersmith
42ac30568e Accept --help & --version as aliases to -? & -V
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/-/merge_requests/25>
2025-04-28 13:11:15 -07:00
Alan Coopersmith
252ca68fef syndaemon: add -V option to print version
Matches synclient -V

Also updates man page to include missing -v option that was listed
in the usage output.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics/-/merge_requests/25>
2025-04-27 16:33:47 -07:00
Alan Coopersmith
46d0532962 Handle a -Wstrict-prototypes/-Wold-style-definition pair of warnings
synclient.c:196:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
  196 | dp_init()
      | ^~~~~~~
synclient.c: In function ‘dp_init’:
synclient.c:196:1: warning: old-style function definition [-Wold-style-definition]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 17:10:41 -08:00
Alan Coopersmith
a9bf2939f0 Handle 5 -Wmissing-prototypes warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 17:08:13 -08:00
Alan Coopersmith
f52912d062 Fix 185 -Wdiscarded-qualifiers warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 17:01:50 -08:00
Alan Coopersmith
13a26918d8 Add X.Org's standard C warning flags to AM_CFLAGS
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-01-05 16:55:03 -08:00
Pip Cet
3e4bc35dfe synclient: allow negative/large values for AreaLeftEdge etc. 2021-04-09 16:58:38 +00:00
Luca Castagnini
59eb0c372b Replace SA_ONESHOT with the more portable SA_RESETHAND.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-26 08:41:12 +10:00
Anton Lindqvist
cd9f979923 syndaemon: enable touchpad when pressing a modifier combo
When ignoring modifiers, ensure the touchpad is enabled once a modifier
key is pressed disregarding any previous key press that caused the
touchpad to be disabled.

Signed-off-by: Anton Lindqvist <anton.lindqvist@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-08-08 10:23:29 +10:00
Gabriele Mazzotta
383355fa5f Remove FastTap leftovers
FastTap was removed with d14ea867ad ("Purge fast-taps option"),
remove all of what remained.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-12 11:08:56 +10:00
Peter Hutterer
17bbcad280 Revert "Add another third state to TouchpadOff for disabling all but button clicks"
This third state is not needed, the behaviour of the touchpad driver is now
good enough to not need an external syndaemon instance to toggle this third
state.

This reverts commit eea7335876.

Conflicts:
	man/synaptics.man
	src/synaptics.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-12 14:13:18 +10:00
Peter Hutterer
eea7335876 Add another third state to TouchpadOff for disabling all but button clicks
On a new set of laptops like the Lenovo T440 the trackstick does not have
physical buttons. Instead, the touchpad's top edge is supposed to acts
software button area. To avoid spurious cursor jumps when the trackstick is in
use and the finger is resting on the touchpad, add another mode that disables
motion events.

Enabled by syndaemon with -t click-only, the default stays unchanged. No
specific integration with the traditional disable-while-typing is needed. On
such touchpads, disabling motion events is sufficient to avoid spurious
events and we don't want to stop HW buttons to send events.

Note that this only adds the new state to the driver and to syndaemon, there
is nothing hooked up otherwise to actually monitor the trackstick.

Special note for syndaemon: optional arguments are a GNU extension, so work
around it by messing with an optstring starting with ":" which allows us to
manually parse the options.

Original version of this patch by John Pham <jhnphm@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-24 08:25:29 +10:00
Peter Hutterer
4f543ce1d6 Revert "Drop circular pad support"
This reverts commit 3b02e7fd81.

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

Conflicts:
	man/synaptics.man
	src/synaptics.c

Acked-by: Daniel Stone <daniel@fooishbar.org>
2014-02-18 07:51:47 +10:00
Peter Hutterer
e0069c1544 Revert "Purge scrollbuttons (repeat)"
This reverts commit 0903d99ada.

Scroll buttons are still present in some modern devices, e.g. the Fujitsu
Lifebook E782 and others in the series.

Conflicts:
	include/synaptics.h
	man/synaptics.man
	src/synaptics.c
2014-01-17 08:24:35 +10:00
Peter Hutterer
109ce14ae1 syndaemon: list -? in help/man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-26 15:21:54 +10:00
Peter Hutterer
eb5f086f29 synclient: support -? for usage
man page and help claim we support this, so let's do so

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-26 15:18:03 +10:00
Peter Hutterer
d059005287 synclient: remove 'm' and 'h' from getopt and man page
Removed as of 83d88b2531

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-26 15:16:19 +10:00
Peter Hutterer
d771cf75b1 tools: drop -s listing in synclient's help output. SHM is gone.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-03-26 15:12:54 +10:00
Peter Hutterer
9ae890cf4e tools: un-typedef TouchpadState
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-31 15:13:41 +10:00
Peter Hutterer
0352c67fa2 tools: coasting speed is not capped at 20, cap it at 255
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-11 10:57:49 +10:00
Peter Hutterer
ebd36c7494 Move synaptics.h leftovers to synapticsstr.h, drop synaptics.h
This leaves us with a duplicated define for the maxbuttons but I'll live
with that for now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 10:06:25 +10:00
Peter Hutterer
3b02e7fd81 Drop circular pad support
Do such devices still exist?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:42:43 +10:00
Peter Hutterer
0903d99ada Purge scrollbuttons (repeat)
I doubt devices that have scrollbuttons are still manufactured. Having
untested code around is just asking for trouble.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:42:36 +10:00
Peter Hutterer
54f65f3ca1 Purge edge motion
A funny feature, but unreliable and mostly untested.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:42:30 +10:00
Peter Hutterer
2c7eab5a6d Drop trackstick emulation mode
"Trackstick emulation mode? That exists?" I hear you say? Yes, indeed. Well,
no, not anymore. This driver is already unmaintainable without features like
this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:42:23 +10:00
Peter Hutterer
83d88b2531 Bury shm - or what was left of it
SHM configuration was removed in Apr 2009 (c09a3d50e9), since then it has
only been usedful for debugging. And we have better tools (evtest) for
debugging hardware events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:42:19 +10:00
Peter Hutterer
d1eebac72e tools: undo indentation in synclient's parameter list
more more readable this way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:21:14 +10:00
Peter Hutterer
0434d77766 Indent consistently
x-indent-all.sh from xorg/util/modular as of
c2d630fab65dbe3409af3947f6f442782ddb026f

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-05-10 09:21:10 +10:00
Alyssa Hung
1874094f0e Support inverted scroll direction.
This patch allows scroll direction to be inverted by allowing
VertScrollDelta and HorizScrollDelta to be set to negative values. This
enables behaviour that is consistent with modern touchscreen devices,
where the content scrolls in the same direction as the user's finger
movement.

Signed-off-by: Alyssa Hung <ahung@isisview.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-04-16 11:44:14 +10:00
Peter Hutterer
c745604461 tools: skip non-existing properties
If a property doesn't exist on a device, skip it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-04-11 11:10:06 +10:00
Chase Douglas
405f1643e2 Add soft button areas property
Some clickpad devices have button areas painted on them. Set this
property to the area of the right and middle buttons to enable proper
click actions when clicking in the areas.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14 08:47:05 +10:00
Chase Douglas
331dd96953 Add clickpad device property
Add it as a writable device property. We may not know how to probe some
clickpads so allow the user to override it.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-14 08:46:54 +10:00
Peter Hutterer
7f5bd79b2e tools: add hysteresis support to synclient
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-03-13 16:18:31 +10:00
Peter Hutterer
dfc3a8ed71 synclient: accept XA_CARDINAL as 32-bit type (#46330)
PressureMotionMaxZ and PressureMotionMinZ were changed from float to
XA_CARDINAL in 24c44375025576dd600ccf370ba365e5d94dc22. Accept the new type.

Fixes:
  PressureMotionMinZ      = format mismatch (32)
  PressureMotionMaxZ      = format mismatch (32)

X.Org Bug 46330 <http://bugs.freedesktop.org/show_bug.cgi?id=46330>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-21 11:42:27 +10:00
Peter Hutterer
53adb8399d synclient: fix indentation of "format mismatch" parameters
Prefix is 4 spaces, not three.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-04 23:44:09 +10:00
Peter Hutterer
dd6c51499e syndaemon: Remove superfluous message.
toggle_touchpad() already prints if we're running verbose.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-28 11:12:25 +10:00
Peter Hutterer
ba53d85025 syndaemon: document exit codes and change them to fall into categories.
Changing pid file creation failure to same exit code that fork() failure
uses.

Changing XRECORD init failure to unique code. This way clients can trap
exit code 4 and re-start syndaemon without the -R flag.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-28 11:12:23 +10:00
Gaetan Nadon
ce1c4ce679 tools: remove unrequired sdkdir include directive
Now that xserver-properties.h is no longer included,
the path to the xserver header files is no longer needed.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-07-11 08:04:41 -04:00
Peter Hutterer
513d40f7c4 tools: don't include xserver-properties.h
Remove the header inclusion to avoid dependency of synclient on the xserver
headers. The only property we need from the server is FLOAT and we can
simply define that here.

Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-11 08:00:20 -04:00
Gaetan Nadon
9d30992ef7 Revert "build: sort building of tools, ensure that cross-pkg-config works."
This reverts commit 4005df6607.

The patch introduces a couple of issues.
1) These tools are apps and conceptually do not depend on Xserver,
so XORG_CFLAGS should not be used. It included pixman header files.
Only drivers depend xserver

2) XORG_CFLAGS may contain, depending on the platform, a compiler
visibilty flag. Compiler flags cannot be assigned to AM_CPPFLAGS
preprocessor flags variable.

There were two changes introduced by the patch.
1) Possible wrong order of include directives
The commit text does not mention which paths may be in the wrong order.

2) Incorrect usage of AM_LDFLAGS
The patch does not really change anything. If the intention was for the tools
to link directly to the libraries, it would look like:

  LDADD =  $(top_builddir)/src/libpciaccess.la # scanpci example

This is only possible for libraries built in the same package.
There is nothing wrong in putting -l -L flags in LDADD, but should there
be other flags, LDFLAGS would be required, ending with two variables.

It looks easier to revert the patch to the previosuly known good version
which has been in service for a year.

Unfortunatly, the reversal breaks distcheck as it removes an unsuspected workaround.
The value of sdkdir during distcheck points to an empty xserver sdkdir
where xserver-properties.h is expected by the tools.

Specifying XORG_CFLAGS worked around the issue by supplying the real path
to the xserver sdk.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-07-05 16:39:33 -04:00
Gaetan Nadon
cb6818b623 Revert "build: collapse all Makefile.am files into a single non-recursive one."
This reverts commit 39afe69ad7.

1. For such a small module, the build time improvement is most likely
negligible. At least, I'd like to see some timings proving it's
worthiness before seeing the patch go back in.

2. This kind of change would need a thorough review. The need to
operate the build from a single toplevel Makefile is a significant
change. The two most noticeable issues for me are that collapsing all
the Makefiles could easily cause namespacing issues with the
variables, and operating on files outside the current directory can
introduce subtle bugs. I feel that the non-recursive style is
generally less robust than the standard recursive make scheme.

3. It's unlike all the other X.org modules. This isn't a showstopper
for me, but the recursive style is well understood here and you've
beaten all the modules into a consistent format that makes build bugs
unique to specific modules less likely.

Acked-by: Dan Nicholson <dbn.lists@gmail.com>

To give a concrete example for #3 above, the 175 man pages are much
easier maintained using a very similar makefile in the man directory
of all X.Org module.

The cost of maintaining a single makefile is much higher. Every target
in the makefile has to be reviewed and tested when changes are made.
Not everyone has the all the skills to handle widely different targets
such as man pages, DocBook/XML, librairies, C code, distribution hooks,
and so on.

Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-07-05 16:39:33 -04:00
Peter Hutterer
be83094bd9 syndaemon: don't compare against a null-property. (#37459)
synaptics_property is not set, touchpad_off_prop is the property we need to
check against.

False check for (nprops != 0) instead of (nprops < 0) would result in
syndaemon always reporting a touchpad device, even if none are present.

X.Org Bug 37459 <http://bugs.freedesktop.org/show_bug.cgi?id=37459>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-26 12:11:34 +10:00
Peter Hutterer
33775253a0 syndaemon: add vim snippet for right indentation/tabstop, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-26 12:11:33 +10:00
Peter Hutterer
e4958186fa syndaemon: fix abysimal indentation in dp_get_device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-26 12:11:33 +10:00
Diego Elio Pettenò
39afe69ad7 build: collapse all Makefile.am files into a single non-recursive one.
With this change, the whole of the build is done non-recursively in the
top-level Makefile.am. This reduces the amount of overhead due to recursing
into directories only to build one file.

Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
Signed-off-by: Christoph Brill <egore911@egore911.de>
2011-05-15 21:46:06 +02:00
Diego Elio Pettenò
4005df6607 build: sort building of tools, ensure that cross-pkg-config works.
Without this change, cross-pkg-config could bring up the wrong paths to
$includedir/xorg, but also fixes linkage to not use LDFLAGS where LDADD
should have been used.

Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
Signed-off-by: Christoph Brill <egore911@egore911.de>
2011-05-15 21:44:12 +02:00
Chase Douglas
bdc9c7cf97 Drain XRecord connection of any events after handling replies
If the X server sends an event to the XRecord connection the event
will never be handled. This will cause the event queue to fill up in
Xlib and lead to syndaemon running away at 100% cpu usage.

This change drains any events from the connection. It's not a fix for
the underlying bug in the server or Xlib, but it does paper over the
issue for now.

https://bugs.launchpad.net/bugs/754470
http://bugs.freedesktop.org/show_bug.cgi?id=31921

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-04-18 13:58:03 +10:00
Peter Hutterer
4ebde557ae Revert "Add synaptics orientation support"
This patch needs more work before we can ship it.

This reverts commit 049d5fb603.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-18 16:25:02 +10:00
Aapo Rantalainen
049d5fb603 Add synaptics orientation support
This patch allows usage of "synclient Orientation=0" (values from 0 to
3). It will rotate the touchpad similar to "xrandr -o". Original patch
was extended for alps and ps2.

Signed-off-by: Christoph Brill <egore911@egore911.de>
2011-03-09 22:27:04 +01:00