368 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
62f01c47f3 (!64) fix struct name clash with Xserver SDK
> /builds/metux/xf86-input-libinput/_builddir/../src/xf86libinput.c: In function 'xf86libinput_set_pressure_range':
> /builds/metux/xf86-input-libinput/_builddir/../src/xf86libinput.c:465:53: warning: declaration of 'range' shadows a global declaration [-Wshadow]
>   465 |                                 const struct range *range)
>       |                                 ~~~~~~~~~~~~~~~~~~~~^~~~~
> In file included from /usr/include/xorg/xf86.h:44,
>                  from /builds/metux/xf86-input-libinput/_builddir/../src/xf86libinput.c:36:
> /usr/include/xorg/xf86str.h:110:3: note: shadowed declaration is here
>   110 | } range;
>       |   ^~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
d8536737f1 (!66) fix warning on unhandled values
> /builds/metux/xf86-input-libinput/_builddir/../src/xf86libinput.c:2617:9: warning: enumeration value 'LIBINPUT_EVENT_TABLET_PAD_KEY' not handled in switch [-Wswitch]
>  2617 |         switch (type) {
>       |         ^~~~~~
> /builds/metux/xf86-input-libinput/_builddir/../src/xf86libinput.c:2617:9: warning: enumeration value 'LIBINPUT_EVENT_GESTURE_HOLD_BEGIN' not handled in switch [-Wswitch]
> /builds/metux/xf86-input-libinput/_builddir/../src/xf86libinput.c:2617:9: warning: enumeration value 'LIBINPUT_EVENT_GESTURE_HOLD_END' not handled in switch [-Wswitch]

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
c65932fa4a (!68) disable pointless warnings
Add -Wno-declaration-after-statement for suppressing pointless warnings
on declarations after statement.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
7389ff0bda (!69) util-strings: drop unused safe_atou()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
28aa704a2e (!69) util-strings: drop unused zalloc()
Not used anywhere. And crashing the Xserver on alloc failure really
isn't a good idea anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
64ba08fc54 (!69) util-strings: drop unused safe_atoi_base()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
b695a892d3 (!69) util-strings: drop unused safe_atoi()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
b952981d05 (!69) util-strings: drop unused safe_strdup()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
060022b4b3 (!69) util-strings: drop unused strv_join()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
3f1207ebeb (!69) util-strings: drop unused strv_from_argv()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
1ca5d08407 (!69) util-strings: drop unused streq() and strneq()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
7721621c89 (!69) util-strings: drop unused kv_double_from_string()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
8644b2724a (!69) util-strings: drop unused strstrip()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
559204d69b (!69) util-strings: drop unused strendswith()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
1b581c5739 (!69) util-strings: drop unused strstartswith()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
d1984c55d7 (!69) util-strings: drop unused safe_basename()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
ef54aca082 (!69) util-strings: drop unused trunkname()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
40e01ab7be (!69) util-strings: drop unused str_sanitize()
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Enrico Weigelt, metux IT consult
e732b6a8e7 (!69) util-strings: don't crash the Xserver on memory alloc failure
It's only consumer already properly checking for NULL return value,
so can directly use calloc() here, instead of zalloc() which is
crashing the Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-09 13:28:53 +01:00
Peter Hutterer
1d7b5c8196 meson.build: install the libinput-properties.h file
Patch provided by Brice De Bruyne

Closes #67

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/71>
xlibre-xf86-input-libinput-1.5.1.0
2025-08-18 10:50:43 +02:00
Oleh Nykyforchyn
a95e7b25e6 src: move _GNU_SOURCE definition before all includes in files that need vasprintf()
Build of input-libinput fails on GCC-11.2 although succeeds on GCC-14.2.
Function vasprintf() becomes implicitle declared because its definition
in stdio.h is guarded by __GLIBC_USE_LIB_EXT2 which depends on _USE_GNU,
which in turn depends on __GNU_SOURCE. __GNU_SOURCE is defined at
the beginning of util_string.h before #include <stdio.h>, and this file
is included by util_strings.c and xf86libinput.c. The latter file
includes first a lot of headers in /usr/include and /usr/include/xorg,
and finally util_string.h. If some of the previous header files
#include <stdio.h>, then it is included first without _GNU_SOURCE, and
vasprintf() is left undefined, which causes a build error.

This patch moves #define _GNU_SOURCE to util_strings.c and xf86libinput.c
from util_strings.h, thus making vasprintf() declaration safe and
independent of a specific compiler.

Signed-off-by: Oleh Nykyforchyn <olen.nyk@gmail.com>
2025-08-18 10:50:14 +02:00
b-aaz
f03931201b configure: Automatically detect the default xorg-module-dir.
The module directory has changed to a per ABI folder in the xlibre-xserver.
Now the default value of `xorg-module-dir` will be detected from the `moduledir` variable in xorg-server.pc.

Signed-off-by: b-aaz <b-aazbsd.proton.me>
2025-07-29 18:51:09 +02:00
Enrico Weigelt, metux IT consult
13559018bd .github: add CI pipeline
This pipeline builds the driver against the latest Xserver stable
release as well as current master.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-29 17:24:43 +02:00
dec05eba
2e1f7a9b3a Improve xinput scrolling factor documentation
Use correct name for "libinput Scrolling Pixel Distance".

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-07-09 19:33:48 +02:00
dec05eba
9e3544b258 Add ScrollFactor option to change mouse/touchpad scroll speed
Add xorg option ScrollFactor.
Add xinput option "libinput Scrolling Factor".

This works well in xi2 applications where they receive the raw scroll
value, however applications that use the core x11 protocol only for input
receive a scroll button press. The frequency this scroll button press
event is sent depends on the value of ScrollFactor, so it works in such
applications as well but the scrolling wont be as "smooth" as if they
used xi2.

gtk, qt, chromium (and electron) applications seem to use xi2 while
firefox does not, unless you set the MOZ_USE_XINPUT2=1 environment
variable.

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-07-09 16:48:28 +02:00
callmetango
cda5a982af .github: Add issue forms
Add the following forms for issue creation:

* Bug report
* Feature request
* Code change
* Documentation update
* Organizational task

* add issue type selection page on "New Issue" call
* mention Github Discussions and the mailing list where appropriate

Part-of: X11Libre/misc#156
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-07-07 17:02:05 +02:00
Enrico Weigelt, metux IT consult
83adc38e59 fix name clash on range parameter
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 19:03:33 +02:00
Enrico Weigelt, metux IT consult
1330f1ded1 util-strings: drop unused xasprintf()
Unsed code and just making trouble on correctly including stdio.h, because
it's using a GNU extension function -- vasprintf().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 16:45:48 +02:00
Enrico Weigelt, metux IT consult
8366e3a41e util-strings: drop unused xvasprintf()
Unsed code and just making trouble on correctly including stdio.h, because
it's using a GNU extension function -- vasprintf().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 16:40:16 +02:00
Alan Coopersmith
9c64c0236c Improve man page formatting
More closely follow common style as described on
https://man7.org/linux/man-pages/man7/man-pages.7.html
and fix warnings raised by `mandoc -T lint` and `groff -rCHECKSTYLE=10`

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/70>
xlibre-xf86-input-libinput-1.5.0.1
2025-06-01 09:32:20 -07:00
Enrico Weigelt, metux IT consult
c674db53d9 fix unused variable click_methods
This variable is only used under certain (build-time) conditions,
so need needs to be defined/assigned under those.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/65>
2025-04-16 23:16:53 +00:00
Enrico Weigelt, metux IT consult
8a63e97e0c ci: fix missing diffutils
> checking if gcc supports -fno-rtti -fno-exceptions... /builds/metux/xf86-input-libinput/_builddir/../configure: line 8891: diff: command not found

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/67>
2025-04-16 15:41:43 +02:00
Peter Hutterer
c712930ef4 xf86-input-libinput 1.5.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-1.5.0
2024-10-15 14:06:00 +10:00
Peter Hutterer
db7cfbe5c2 test: fix some scan-build warnings
e.g.
../../../test/test-draglock.c:262:2: warning: Value stored to 'rc' is never read [deadcode.DeadStores]
  262 |         rc = draglock_init_from_string(&dl, "10");
2024-10-15 13:58:18 +10:00
Peter Hutterer
cb80d7f82d Map some specific high keycodes into the FK20-23 range
These mappings have been part of xkeyboard-config for over a decade and
the likely reason they were introduced is that the corresponding evdev
keycode is > 255.

Let's forcibly remap those in the driver here so the rest of the system
can switch to the real keycodes instead of having to map them to the
whatever X expects.

See https://github.com/systemd/systemd/pull/34325/

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/62>
2024-10-09 23:25:17 +00:00
Peter Hutterer
7c5635cd6f Silence a compiler warning
../src/xf86libinput.c: In function ‘prop_draglock_set_pairs’:
../src/xf86libinput.c:5153:30: warning: comparison is always false due to limited range of data type [-Wtype-limits]
 5153 |                 if (pairs[i] > MAX_BUTTONS)

MAX_BUTTONS is defined by the server so let's use a temporary local
variable to silence the compiler.

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/61>
2024-10-09 14:02:44 +10:00
Peter Hutterer
b396ba3697 Prevent theoretical null-pointer dereference
Cannot happen since we don't enter this function if the atom isn't one
of the three checked above but the static analyzer doesn't know that.

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/60>
2024-09-13 03:06:20 +00:00
Martin Rys
0bcb60e744 Add support for LIBINPUT_LED_COMPOSE/LIBINPUT_LED_KANA
Added in libinput 1.26

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/58>
2024-09-12 09:31:01 +10:00
Peter Hutterer
3a33984cce Fix a bunch of whitespace issues
xf86libinput_kbd_ctrl() in particular was a copy/paste with 4-space
indentation, the rest is mostly space->tab replacement.

As pointed out in !58

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/59>
2024-09-06 10:14:31 +10:00
Peter Hutterer
bb41cc730c Add support for clickfinger button maps 2024-07-19 11:44:49 +10:00
Peter Hutterer
72c8eb25f8 Implement tablet tool pressure range support 2024-06-10 09:27:57 +00:00
Peter Hutterer
74335c6fd6 Revert "fix int type mismatches in printf()-like calls"
This now warns on 64-bit machines:
../src/xf86libinput.c:542:61: warning: format ‘%lu’ expects argument
of type ‘long unsigned int’, but argument 4 has type ‘CARD32’ {aka ‘unsigned int’} [-Wformat=]

Given they vastly outnumber 32-bit machines now, let's go back to the
old one that only warns on 32 bit until we fix the actual source types
to use uint32_t and similar.

This reverts commit a7d2994256.
2024-06-07 11:14:17 +10:00
Enrico Weigelt, metux IT consult
b791b30b1f update .gitignore
"test/test-bezier" was yet missing

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-21 13:21:09 +01:00
Enrico Weigelt, metux IT consult
a7d2994256 fix int type mismatches in printf()-like calls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-21 13:21:09 +01:00
Enrico Weigelt, metux IT consult
c6b4d2732f replace BUG_() macros by xf86IDrvMsg() calls
Latest master moved the BUG_() macros out of os.h, and it's more appropriate
to use xf86IDrvMsg() in those cases (like we're already doing in other places)
anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-21 13:19:47 +01:00
Peter Hutterer
6ed6814489 gitlab CI: update to latest templates and current fedora 2024-02-20 08:24:15 +10:00
Peter Hutterer
a24f467576 Add editorconfig file 2024-02-20 08:22:16 +10:00
Peter Hutterer
b254d491e2 Add a property for the tablet tool serial and hw ID
The driver encodes the serial in the device name but that's not reliable
enough. Expose both serial and tool id (optional) as a property so
clients can read them and adjust their behavior accordingly.

Fixes #16
2023-11-10 08:17:46 +10:00
Peter Hutterer
0dc42f0e4e Sort the read-only properties 2023-11-10 08:16:59 +10:00
Peter Hutterer
46af622e9d xf86-input-libinput 1.4.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xf86-input-libinput-1.4.0
2023-08-25 13:51:18 +10:00