Commit graph

4570 commits

Author SHA1 Message Date
Peter Hutterer
ca1c05ab44 test: create devices for our udev seat checks
This way we can ensure that at least one device is available, and that
it is the device we want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-09 10:50:25 +10:00
José Expósito
7265d1676f editorconfig: add settings for meson files
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-04 05:58:29 +00:00
Peter Hutterer
b925b55634 test: use MESON_TESTTHREADS to determine the number of jobs
meson uses MESON_TESTTHREADS to determine the number of parallel test
jobs. Since our main test suite cannot be run in parallel anyway, use
that same variable in litest to determine how many jobs we should fork
off.

In the CI pipeline, we can use FDO_CI_CONCURRENT to pass that down so we
don't end up running a billion jobs on a test runner.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-03 22:14:29 +00:00
José Expósito
375618b81b meson.build: use the / operator instead of join_paths
Starting with meson v0.49.0, the "/" operator can be used instead of
join_paths.

Update meson to v0.49.0 and remove all calls to join_paths.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 20:00:37 +02:00
José Expósito
44212baaf1 ci: update to GTK 4 when available
Update GTK to version 4 on Fedora, Arch and Alpine Linux.

Not updating Debian and FreeBSD because the package is not available yet
and Ubuntu because it is not available on 20.10.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
be7264f35b debug-gui: pointer locking on X11
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
a9b334ebb5 debug-gui: pointer locking on Wayland
Use the pointer constraints protocol to lock the pointer on Wayland.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
895e866da6 debug-gui: migrate to GTK4
Global:

- Stop passing commandline arguments to gtk_init:
  https://docs.gtk.org/gtk4/migrating-3to4.html#stop-passing-commandline-arguments-to-gtk_init

window_init function:

- gtk_window_new doesn't require a type anymore

- gtk_window_iconify has been renamed to gtk_window_minimize

- gtk_container_add has been removed in favor of container specific
  APIs. Use gtk_window_set_child in this case.

- gtk_widget_show_all has been removed, widgets are now visible by
  default:
  https://docs.gtk.org/gtk4/migrating-3to4.html#widgets-are-now-visible-by-default

- gtk_widget_set_events to NULL is no longer required, widgets must set
  their event handlers explicitly now:
  https://blog.gtk.org/2020/04/29/custom-widgets-in-gtk-4-input/

window_delete_event_cb function:

- Use the new close-request event:
  https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-gtkwidget-event-signals

map_event_cb function:

- gtk_widget_set_cursor_from_name instead of gdk_window_set_cursor

- Wait until the draw area is resized to use the whole window to start
  calculating sizes

window_place_ui_elements function:

- Use gtk_widget_get_width and gtk_widget_get_height instead of
  gtk_window_get_size

Drawing:

- Use gtk_drawing_area_set_draw_func instead of the GtkWidget::draw
  signal:
  https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-drawing-model-changes

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
55889adeff tools/debug-gui: refactor UI element placement
Move the code used to pace the different UI elements to its own
function.

Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
791fbad5b9 tools/debug-gui: use GMainLoop instead of gtk_main
Migrate to GMainLoop because gtk_main is deprecated in GTK 4.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
José Expósito
f36ccc3c11 tools/debug-gui: move gtk_main_quit to a function
Wrap the calls to gtk_main_quit in its own function.

Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03 16:52:39 +00:00
Peter Hutterer
c21f20cc5a meson.build: disable documentation by default
This does little other than drag in a whole bunch of dependencies. The
libinput documentation is designed to be consumed online, so there's no
need building it on every machine.

We leave the dependencies installed in the images because it's a lot
easier to remove them and test if the build still works than adding them
and dragging in every updated package since we built the image.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-03 12:11:09 +10:00
satrmb
1773973d4d quirks: Chuwi AeroBook Plus has a clickpad falsely claiming to have BTN_RIGHT
Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
2021-07-30 22:59:22 +02:00
Quytelda Kahja
e8bcf71c69
test: Add test for parsing of boolean quirk attributes.
Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
2021-07-30 06:11:20 -07:00
José Expósito
140b4b7853 doc: add common failed pipeline errors
Add a section in the contributing documentation with common pipeline
errors and how to fix them and point to this page when the CI fails.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-07-30 05:21:59 +00:00
Peter Hutterer
355635ad4f gitlab CI: drop dependencies between jobs
None of our jobs rely on the artifacts of a previous job, so let's not
pass those around. Make this part of the default policy and include it
from every job.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-29 15:38:01 +00:00
Quytelda Kahja
fc24bba7b3 Add section for Lenovo Yoga C930 tablet in 50-system-lenovo.quirks.
Fixes #632.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
2021-07-28 23:53:36 +00:00
Quytelda Kahja
e6c4b1d16e quirks: Add tablet smoothing attribute.
https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/512 disables
input smoothing for AES devices. However, some AES devices produce
segmented/wobbly curves without smoothing. This change introduces an
`AttrTabletSmoothing` boolean property, which overrides the default smoothing
behavior.

See #632

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
2021-07-28 23:53:36 +00:00
Sanjiv
8ee8537491 Update quirks/50-system-chuwi.quirks
Author:    Sanjiv <sanjerat@gmail.com>
Date:      Wed Jul 28 04:27:56 2021 +0000
Signed-off-by: Sanjiv Erat <sanjerat@gmail.com>
2021-07-28 22:37:35 +00:00
Kevin Anderson
eb2ed1863e quirks: add Framework Touchpad Quirk
Handle a bug that the touchpad announces BTN_RIGHT

Signed-off-by: Kevin Anderson <andersonkw2@gmail.com>
2021-07-28 16:47:48 -04:00
Peter Hutterer
79707b91c7 gitlab CI: debug the meson_build script
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 12:50:11 +10:00
Peter Hutterer
047557b7f0 Define the versionsort overrides as inlines
Squashes compiler warnings about unused functions given this header is
included in multiple files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 12:50:11 +10:00
Peter Hutterer
833e49ce01 gitlab CI: use the ci-templates FreeBSD templates
Replace our cross-compilation for FreeBSD with a proper template.
FreeBSD doesn't do normal containers so we need a bunch of if/else to
skip the container builds.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 12:50:11 +10:00
Peter Hutterer
21824bc6ff gitlab CI: move the SUITES handling to the template where it matters
Should have been part of 9133693b15.

This fixes an issue with calls to meson_build.sh with an otherwise empty
MESON_TEST_ARGS - thanks to the space before $SUITES it would no longer
the zero-string condition in meson_build.sh.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 12:48:56 +10:00
Peter Hutterer
94fc9b2200 gitlab CI: update to latest ci-templates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 09:46:20 +10:00
Peter Hutterer
9133693b15 gitlab CI: split the qemu meson build parts out as separate template
This was part of the test-suite-vm template but to make it easily
re-usable split out the parts that are just about building in a qemu
image from the parts that are specific to running the test suites.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 09:46:17 +10:00
Peter Hutterer
6516374ded gitlab CI: name the qemu tags per distribution
Having only one qemu tag worked only because we only had one
distribution using qemu. If we have multiple of those we just
duplicate/overwrite the variable so let's not do that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-28 08:59:09 +10:00
Peter Hutterer
ad239327c0 doc/user: move the hold gesture section up to the others
Better structuring this way: pinch, swipe, hold, then other comments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-27 05:20:45 +00:00
Peter Hutterer
67405c2790 doc/user: fix the line alignments for the hold gesture tables
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-27 05:20:45 +00:00
Andrea Ippolito
967b9d3e45 doc/user: make "verifying install" command portable
According to the linker man page libraries are searched in the following paths:
LD_LIBRARY_PATH environment variable
Paths in the cache file /etc/ld.so.cache
/lib, /usr/lib, /lib64 and /usr/lib64
As we are not using LD_LIBRARY_PATH, we can rely on ldconfig as a fairly portable solution because it "creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib)".

Tested on fedora 34, manjaro 2021.07, kubuntu 21.04

Signed-off-by: Andrea Ippolito <andrea.ippo@gmail.com>
2021-07-26 12:35:33 +02:00
Peter Hutterer
2cf38f45a5 touchpad: remove two unused functions
These functions have been unused since 1668cd5e81

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
Peter Hutterer
9564b3c1e2 Mark some functions as printf-like to silence some compiler warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
Peter Hutterer
7cccee251f Disable -Wmissing-field-initializers
We really don't care about that one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
Peter Hutterer
fc70c4f862 Silence compiler warnings for -Wformat-nonliteral
In the various logging functions where we need to modify the format
argument, disable the compiler warnings. Interestingly, GCC doesn't seem
to mind those but building with clang unleashes pages of warnings.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
Peter Hutterer
234eeabe2f Replace fallthrough comments with __attribute__((fallthrough))
This has recently been endorsed by the linux kernel, it should be good
enough for us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
Peter Hutterer
492f6817d3 util-list: restore list_for_each_safe() to be a single statement
3d3d9b7f69 got rid of the need for a tmp
argument for list_for_each_safe() but switched the loop to be a
multiline statement. This could potentially cause bugs where the loop is
used inside a block without curly braces, e.g.

    if (condition)
        list_for_each_safe()
            func()

The assignment preceding the actual loop would result in the code
reading as:

    if (condition)
        pos = ....

    list_for_each_safe()

The actual list loop would be unconditional.

Fix this by moving the initial assignment into an expression statement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 12:53:08 +10:00
Peter Hutterer
29d311d634 quirks: add a quirk for the X61 bezel buttons
Fixes #628

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-13 21:58:24 +00:00
The_Observer
0a354dc16f quirks: add a quirk for the Purism Librem 14v1
Clickpad that announces BTN_RIGHT
Fixes #629

Signed-off-by: The_Observer <The_Observer@lindemann.space>
2021-07-13 21:28:57 +00:00
Mohamed Elsharnouby
5a23665dfb quirks: add pressure range for Dell Latitude 7480
Pressing Ctrl/Shift on this model triggers light touches that causes random clicks.
This doesn't occur on Windows 10 so adding this quirk to fix it

Signed-off-by: sharno <sharnoby3@gmail.com>
2021-07-11 19:00:42 -04:00
Thomas Stenhouse-Pyne
0ddb26a068 quirks: add volume rocker quirk for Lenovo Duet 7i
Signed-off-by: Thomas Stenhouse-Pyne <tommpyne@gmail.com>
2021-06-26 12:01:36 +01:00
Thomas Weißschuh
b7aac3c148 evdev: remove device when it is gone
This was observed when running in device mode with:
`libinput debug-events $EVENT_NODE`

When removing the monitored device, the no "device removed" message was
not shown.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2021-06-21 10:41:19 +00:00
Peter Hutterer
17783c24df quirks: add a quirk for the Huawei Matebook 2020 touchpad
Clickpad that announces BTN_RIGHT

https://bugzilla.redhat.com/show_bug.cgi?id=1972370

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-21 08:52:27 +10:00
Peter Hutterer
6aa24d1054 gitlab CI: add a comment to explain how to actually edit the CI
We tell users not to edit it, but don't tell them how to change it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-17 16:10:53 +10:00
luokai
87447a0ee9 using secure functions safe_strdup
Signed-off-by: luokai <l18674732394.com>
2021-06-15 11:27:29 +08:00
Peter Hutterer
9cd6f3c5b8 meson.build: bump to 1.18.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-10 11:46:41 +10:00
José Expósito
1f548864bc gestures: improve one finger hold detection
When one finger is used to hold, tiny pointer movement deltas can easily
end the gesture.

Add a movement threshold to avoid small movement, before or after the hold
timeout, ending the gesture and make the hold-to-interact user
interaction more reliable.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-06-10 01:07:19 +00:00
José Expósito
45e6e28ca2 gestures: move first_moved and first_mm up
Move the calculation of first_moved and first_mm up inside
tp_gesture_detect_motion_gestures in order to be able to use their
values in the one finger code path.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-06-10 01:07:19 +00:00
José Expósito
13c47598bc gestures: always save touch information
When a single touch is used to hold or to move the pointer, save
information about the touch.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-06-10 01:07:19 +00:00
José Expósito
5603ed867d doc: update draw.io URL
The tool used to generate diagrams (draw.io) is now diagrams.net.

Update the URL in the comments.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-06-09 22:12:35 +00:00
José Expósito
8aed8b6df6 doc: add touchpad gestures state machine diagram
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-06-09 22:12:35 +00:00