Compare commits

...

6 commits
main ... 1.8.1

Author SHA1 Message Date
Peter Hutterer
cc9a4debd3 configure.ac: libinput 1.8.1 2017-07-19 10:01:03 +10:00
Peter Hutterer
c75e052ad4 touchpad: set keyboard to non-active when the keyboard is removed
If the keyboard is removed while dwt thinks it is in active state, that state
is never reset and subsequent touches are ignored.

https://bugs.freedesktop.org/show_bug.cgi?id=101743

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9e5d1df4bb)
2017-07-13 15:08:34 +10:00
Peter Hutterer
429fc47bb1 Add support for CircleCI
This isn't currently hooked up to the fdo repo but it's hooked up to my
github mirror. I had SemaphoreCI hooked up to that before but it only
supports ubuntu 14.04 and the recent meson switch made it a bit hard to setup.

CircleCI supports running docker containers, so let's do that and run against
the most recent released Fedora and a recent Ubuntu. I'm not bothering with
rawhide, it's likely to increase the work for little gain when it's in a
semi-broken state.

Run the default build with a few permutations to test meson options. Run
scan-build too but that's just for the logs, eventually this may turn into a
hard failure.

Ubuntu 17.04's meson is too old, so we have to clone that from git. Install
arguments are taken from the meson.deb package.

Most of this effort was done by Benjamin Tissoires.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit eb36957625)
2017-07-10 15:17:18 +10:00
Peter Hutterer
b6ce9c0f3b doc: expand on the meson build instructions
https://bugs.freedesktop.org/show_bug.cgi?id=101686

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 7b98f8ef47)
2017-07-10 15:16:43 +10:00
Peter Hutterer
40439b7347 meson: fix build with --libwacom=false
Triggered an error because we still used dep_libwacom unconditionally:
	Meson encountered an error in file meson.build, line 76, column 0:
	Unknown variable "dep_libwacom".

https://bugs.freedesktop.org/show_bug.cgi?id=101693

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c6e0c96e74)
2017-07-10 15:16:39 +10:00
Peter Hutterer
d1a575c8e5 touchpad: increase palm edge zones to 8%
Most modern touchpads are around 100mm wide, so this provides a ca 8mm edge
zone on each side. The extra 3mm should provide for more reliable palm
detection, a few touches happen to be just on the edge of the 5mm mark.

https://bugs.freedesktop.org/show_bug.cgi?id=101433

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 381cce8ddd)
2017-07-10 15:16:37 +10:00
6 changed files with 219 additions and 9 deletions

151
circle.yml Normal file
View file

@ -0,0 +1,151 @@
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
libinput_jobs:
default_settings: &default_settings
working_directory: ~/libinput
# Define a couple of standardized build targets
# that we call from every build container
build_and_test_default: &build_and_test_default
name: Build
command: |
rm -rf build
meson build ${MESON_PARAMS}
mesonconf build
ninja -v -C build ${NINJA_ARGS}
environment:
MESON_PARAMS: --prefix=/opt/libinput
build_and_test: &build_and_test
run:
<<: *build_and_test_default
build_no_libwacom: &build_no_libwacom
run:
<<: *build_and_test_default
name: Build - No libwacom
environment:
MESON_PARAMS: -Dlibwacom=false
build_no_debug_gui: &build_no_debug_gui
run:
<<: *build_and_test_default
name: Build - No debug-gui
environment:
MESON_PARAMS: -Ddebug-gui=false
build_no_tests: &build_no_tests
run:
<<: *build_and_test_default
name: Build - No tests
environment:
MESON_PARAMS: -Dtests=false
build_no_docs: &build_no_docs
run:
<<: *build_and_test_default
name: Build - No docs
environment:
MESON_PARAMS: -Ddocumentation=false
ninja_scan_build: &ninja_scan_build
run:
<<: *build_and_test_default
name: Ninja scan-build
environment:
NINJA_ARGS: scan-build
install: &install
run:
name: Installing
command: ninja -v -C build install
export_logs: &export_logs
store_artifacts:
path: ~/libinput/build/meson-logs
# Ubuntu's meson is too old, these instructions are
# meson-specific
meson_from_git: &meson_from_git
run:
name: Install meson from git
environment:
MESON_VERSION: 0.41.0
command: |
git clone https://github.com/mesonbuild/meson
pushd meson
git checkout -f ${MESON_VERSION}
python3 ./setup.py install --prefix=/usr --install-layout=deb --install-lib=/usr/share/meson --install-scripts=/usr/share/meson
popd
rm -rf meson
fedora_install: &fedora_install
run:
name: Install prerequisites
command: |
dnf install -y git gcc gcc-c++ meson check-devel libudev-devel libevdev-devel doxygen graphviz valgrind binutils libwacom-devel cairo-devel gtk3-devel glib2-devel mtdev-devel
fedora_build_all: &fedora_build_all
<<: *default_settings
steps:
- *fedora_install
- checkout
- *build_and_test
- *install
- *export_logs
- *build_no_libwacom
- *build_no_debug_gui
- *build_no_tests
- *build_no_docs
ubuntu_install: &ubuntu_install
run:
name: Install prerequisites
command: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y git gcc g++ meson check libudev-dev libevdev-dev doxygen graphviz valgrind binutils libwacom-dev libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev
ubuntu_build_all: &ubuntu_build_all
<<: *default_settings
steps:
- *ubuntu_install
- *meson_from_git # meson version not recent enough
- checkout
- *build_and_test
- *install
- *export_logs
- *build_no_libwacom
- *build_no_debug_gui
- *build_no_tests
- *build_no_docs
scan_build_run: &scan_build_run
<<: *default_settings
steps:
- *fedora_install
- run:
name: Install clang and find
command: dnf install -y clang-analyzer findutils
- checkout
- *ninja_scan_build
- *export_logs
- run:
name: Check scan-build results
command: test ! -d ~/libinput/build/meson-logs/scanbuild || test $(find ~/libinput/build/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 || (echo "Check scan-build results" && false)
version: 2
jobs:
fedora_latest:
<<: *fedora_build_all
docker:
- image: fedora:latest
ubuntu_17_04:
<<: *ubuntu_build_all
docker:
- image: ubuntu:zesty
scan_build:
<<: *scan_build_run
docker:
- image: fedora:latest
workflows:
version: 2
compile:
jobs:
- fedora_latest
- scan_build
- ubuntu_17_04

View file

@ -2,7 +2,7 @@ AC_PREREQ([2.64])
m4_define([libinput_major_version], [1])
m4_define([libinput_minor_version], [8])
m4_define([libinput_micro_version], [0])
m4_define([libinput_micro_version], [1])
m4_define([libinput_version],
[libinput_major_version.libinput_minor_version.libinput_micro_version])

View file

@ -26,15 +26,29 @@ $> sudo ninja -C builddir/ install
$> sudo udevadm hwdb --update
@endcode
The ```prefix``` option or other options can be changed later with the
```mesonconf``` command.
Additional options may also be specified. For example:
@code
$> mesonconf builddir/ -Dprefix=/some/other/prefix
$> meson --prefix=/usr -Ddocumentation=false -Dlibwacom=false builddir/
@endcode
The ```prefix``` or other options can be changed later with the
```mesonconf``` command. For example:
@code
$> mesonconf builddir/ -Dprefix=/some/other/prefix -Ddocumentation=true
$> ninja -C builddir
$> sudo ninja -C builddir/ install
@endcode
Running ``mesonconf builddir/`` with no other arguments lists all
configurable options meson provides.
To rebuild from scratch, simply remove the build directory and run meson
again:
@code
$> rm -r builddir/
$> meson --prefix=....
@endcode
@subsection building_autotools Building with automake
libinput currently also provides the autotools build system, but this will

View file

@ -1,5 +1,5 @@
project('libinput', 'c', 'cpp',
version : '1.8.0',
version : '1.8.1',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.40.0')
@ -62,6 +62,8 @@ if have_libwacom
name : 'libwacom_get_paired_device check',
dependencies : dep_libwacom)
config_h.set10('HAVE_LIBWACOM_GET_PAIRED_DEVICE', result)
else
dep_libwacom = declare_dependency()
endif
############ udev bits ############

View file

@ -1740,6 +1740,7 @@ tp_interface_device_removed(struct evdev_device *device,
libinput_device_remove_event_listener(
&tp->dwt.keyboard_listener);
tp->dwt.keyboard = NULL;
tp->dwt.keyboard_active = false;
}
if (removed_device == tp->lid_switch.lid_switch) {
@ -2278,12 +2279,12 @@ tp_init_palmdetect_edge(struct tp_dispatch *tp,
if (width < 70.0)
return;
/* palm edges are 5% of the width on each side */
mm.x = width * 0.05;
/* palm edges are 8% of the width on each side */
mm.x = width * 0.08;
edges = evdev_device_mm_to_units(device, &mm);
tp->palm.left_edge = edges.x;
mm.x = width * 0.95;
mm.x = width * 0.92;
edges = evdev_device_mm_to_units(device, &mm);
tp->palm.right_edge = edges.x;
}

View file

@ -3819,6 +3819,47 @@ START_TEST(touchpad_dwt_enable_during_tap)
}
END_TEST
START_TEST(touchpad_dwt_remove_kbd_while_active)
{
struct litest_device *touchpad = litest_current_device();
struct litest_device *keyboard;
struct libinput *li = touchpad->libinput;
if (!has_disable_while_typing(touchpad))
return;
litest_enable_tap(touchpad->libinput_device);
enable_dwt(touchpad);
keyboard = dwt_init_paired_keyboard(li, touchpad);
litest_drain_events(li);
litest_keyboard_key(keyboard, KEY_A, true);
litest_keyboard_key(keyboard, KEY_A, false);
libinput_dispatch(li);
litest_touch_down(touchpad, 0, 50, 50);
libinput_dispatch(li);
litest_keyboard_key(keyboard, KEY_A, true);
litest_keyboard_key(keyboard, KEY_A, false);
litest_drain_events(li);
litest_delete_device(keyboard);
litest_drain_events(li);
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
litest_touch_up(touchpad, 0);
litest_assert_empty_queue(li);
litest_touch_down(touchpad, 0, 50, 50);
litest_touch_move_to(touchpad, 0, 50, 50, 70, 50, 10, 1);
litest_touch_up(touchpad, 0);
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
}
END_TEST
START_TEST(touchpad_dwt_apple)
{
struct litest_device *touchpad = litest_current_device();
@ -5071,6 +5112,7 @@ litest_setup_tests_touchpad(void)
litest_add("touchpad:dwt", touchpad_dwt_enable_during_touch, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_enable_before_touch, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_enable_during_tap, LITEST_TOUCHPAD, LITEST_ANY);
litest_add("touchpad:dwt", touchpad_dwt_remove_kbd_while_active, LITEST_TOUCHPAD, LITEST_ANY);
litest_add_for_device("touchpad:dwt", touchpad_dwt_apple, LITEST_BCM5974);
litest_add_for_device("touchpad:dwt", touchpad_dwt_acer_hawaii, LITEST_ACER_HAWAII_TOUCHPAD);