Mir

Merge lp:~vanvugt/mir/disable-libinput-pointer-acceleration into lp:mir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~vanvugt/mir/disable-libinput-pointer-acceleration
Merge into: lp:mir
Diff against target: 71 lines (+18/-2)
4 files modified
src/platforms/evdev/libinput_device.cpp (+2/-2)
tests/include/mir/test/doubles/mock_libinput.h (+2/-0)
tests/mir_test_doubles/mock_libinput.cpp (+10/-0)
tests/unit-tests/input/evdev/test_libinput_device.cpp (+4/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/disable-libinput-pointer-acceleration
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andreas Pokorny (community) Disapprove
Daniel d'Andrada (community) Needs Information
Review via email: mp+280424@code.launchpad.net

Commit message

First quick and dirty prototype illustrating a fix for the pointer
acceleration issues introduced by libinput in Mir 0.18:
LP: #1524145 and LP: #1522295

This proof-of-concept just uses the native kernel/device motion data,
like Mir 0.17 and prior did. So the mouse cursor is smooth and
consistent again.

This is not the final answer though, as we would like a solution where
the acceleration is configurable. But it does suffice in resolving the
regressions that libinput brought in Mir 0.18 right now. So the mouse
experience is exactly as it was in Mir 0.17 and earlier.

Description of the change

An alternative fix (which we should do next) would be to revert this two line change and set the default profile to no acceleration instead of disabling it. But that would appear to be more involved so will take more time.

To post a comment you must log in.
Daniel d'Andrada (dandrader) wrote :

Will that remove pointer acceleration from Unity8?

review: Needs Information
Andreas Pokorny (andreas-pokorny) wrote :

> Will that remove pointer acceleration from Unity8?

yes..

Andreas Pokorny (andreas-pokorny) wrote :

this is the wrong approach.

review: Disapprove
Daniel van Vugt (vanvugt) wrote :

Correct. But it's proof the problem and solution are potentially simple.

PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:3194
http://jenkins.qa.ubuntu.com/job/mir-ci/5840/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-vivid-i386-build/5301
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-clang-vivid-amd64-build/4207
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-vivid-touch/5250
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-xenial-touch/151/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/168
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-amd64-ci/168/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/168
        deb: http://jenkins.qa.ubuntu.com/job/mir-xenial-i386-ci/168/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5250
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-vivid-armhf/5250/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-touch/7770
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26013
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/149
        deb: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-builder-xenial-armhf/149/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-mediumtests-runner-xenial-touch/8/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26018

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/mir-ci/5840/rebuild

review: Approve (continuous-integration)

Unmerged revisions

3194. By Daniel van Vugt on 2015-12-14

First quick and dirty prototype illustrating a fix for the pointer
acceleration issues introduced by libinput in Mir 0.18:
LP: #1524145 and LP: #1522295

This proof-of-concept just uses the native kernel/device motion data,
like Mir 0.17 and prior did. So the mouse cursor is smooth and
consistent again.

This is not the final answer though, as we would like a solution where
the acceleration is configurable. But it does suffice in resolving the
regressions that libinput brought in Mir 0.18 right now. So the mouse
experience is exactly as it was in Mir 0.17 and earlier.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/evdev/libinput_device.cpp'
2--- src/platforms/evdev/libinput_device.cpp 2015-12-07 01:13:18 +0000
3+++ src/platforms/evdev/libinput_device.cpp 2015-12-14 08:54:29 +0000
4@@ -168,8 +168,8 @@
5 report->received_event_from_kernel(time.count(), EV_REL, 0, 0);
6
7 mir::geometry::Displacement const movement{
8- libinput_event_pointer_get_dx(pointer),
9- libinput_event_pointer_get_dy(pointer)};
10+ libinput_event_pointer_get_dx_unaccelerated(pointer),
11+ libinput_event_pointer_get_dy_unaccelerated(pointer)};
12
13 return builder->pointer_event(time, action, button_state, hscroll_value, vscroll_value, movement.dx.as_float(),
14 movement.dy.as_float());
15
16=== modified file 'tests/include/mir/test/doubles/mock_libinput.h'
17--- tests/include/mir/test/doubles/mock_libinput.h 2015-12-07 01:13:18 +0000
18+++ tests/include/mir/test/doubles/mock_libinput.h 2015-12-14 08:54:29 +0000
19@@ -61,7 +61,9 @@
20 MOCK_METHOD1(libinput_event_pointer_get_time, uint32_t(libinput_event_pointer*));
21 MOCK_METHOD1(libinput_event_pointer_get_time_usec, uint64_t(libinput_event_pointer*));
22 MOCK_METHOD1(libinput_event_pointer_get_dx, double(libinput_event_pointer*));
23+ MOCK_METHOD1(libinput_event_pointer_get_dx_unaccelerated, double(libinput_event_pointer*));
24 MOCK_METHOD1(libinput_event_pointer_get_dy, double(libinput_event_pointer*));
25+ MOCK_METHOD1(libinput_event_pointer_get_dy_unaccelerated, double(libinput_event_pointer*));
26 MOCK_METHOD1(libinput_event_pointer_get_absolute_x, double(libinput_event_pointer*));
27 MOCK_METHOD1(libinput_event_pointer_get_absolute_y, double(libinput_event_pointer*));
28 MOCK_METHOD2(libinput_event_pointer_get_absolute_x_transformed, double(libinput_event_pointer*, uint32_t));
29
30=== modified file 'tests/mir_test_doubles/mock_libinput.cpp'
31--- tests/mir_test_doubles/mock_libinput.cpp 2015-12-07 01:13:18 +0000
32+++ tests/mir_test_doubles/mock_libinput.cpp 2015-12-14 08:54:29 +0000
33@@ -152,11 +152,21 @@
34 return global_libinput->libinput_event_pointer_get_dx(event);
35 }
36
37+double libinput_event_pointer_get_dx_unaccelerated(libinput_event_pointer* event)
38+{
39+ return global_libinput->libinput_event_pointer_get_dx_unaccelerated(event);
40+}
41+
42 double libinput_event_pointer_get_dy(libinput_event_pointer* event)
43 {
44 return global_libinput->libinput_event_pointer_get_dy(event);
45 }
46
47+double libinput_event_pointer_get_dy_unaccelerated(libinput_event_pointer* event)
48+{
49+ return global_libinput->libinput_event_pointer_get_dy_unaccelerated(event);
50+}
51+
52 double libinput_event_pointer_get_absolute_x(libinput_event_pointer* event)
53 {
54 return global_libinput->libinput_event_pointer_get_absolute_x(event);
55
56=== modified file 'tests/unit-tests/input/evdev/test_libinput_device.cpp'
57--- tests/unit-tests/input/evdev/test_libinput_device.cpp 2015-12-07 01:13:18 +0000
58+++ tests/unit-tests/input/evdev/test_libinput_device.cpp 2015-12-14 08:54:29 +0000
59@@ -292,8 +292,12 @@
60 .WillByDefault(Return(event_time));
61 ON_CALL(mock_libinput, libinput_event_pointer_get_dx(pointer_event))
62 .WillByDefault(Return(relatve_x));
63+ ON_CALL(mock_libinput, libinput_event_pointer_get_dx_unaccelerated(pointer_event))
64+ .WillByDefault(Return(relatve_x));
65 ON_CALL(mock_libinput, libinput_event_pointer_get_dy(pointer_event))
66 .WillByDefault(Return(relatve_y));
67+ ON_CALL(mock_libinput, libinput_event_pointer_get_dy_unaccelerated(pointer_event))
68+ .WillByDefault(Return(relatve_y));
69 }
70
71 void setup_absolute_pointer_event(libinput_event* event, uint64_t event_time, float x, float y)

Subscribers

People subscribed via source and target branches