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
=== modified file 'src/platforms/evdev/libinput_device.cpp'
--- src/platforms/evdev/libinput_device.cpp 2015-12-07 01:13:18 +0000
+++ src/platforms/evdev/libinput_device.cpp 2015-12-14 08:54:29 +0000
@@ -168,8 +168,8 @@
168 report->received_event_from_kernel(time.count(), EV_REL, 0, 0);168 report->received_event_from_kernel(time.count(), EV_REL, 0, 0);
169169
170 mir::geometry::Displacement const movement{170 mir::geometry::Displacement const movement{
171 libinput_event_pointer_get_dx(pointer),171 libinput_event_pointer_get_dx_unaccelerated(pointer),
172 libinput_event_pointer_get_dy(pointer)};172 libinput_event_pointer_get_dy_unaccelerated(pointer)};
173173
174 return builder->pointer_event(time, action, button_state, hscroll_value, vscroll_value, movement.dx.as_float(),174 return builder->pointer_event(time, action, button_state, hscroll_value, vscroll_value, movement.dx.as_float(),
175 movement.dy.as_float());175 movement.dy.as_float());
176176
=== modified file 'tests/include/mir/test/doubles/mock_libinput.h'
--- tests/include/mir/test/doubles/mock_libinput.h 2015-12-07 01:13:18 +0000
+++ tests/include/mir/test/doubles/mock_libinput.h 2015-12-14 08:54:29 +0000
@@ -61,7 +61,9 @@
61 MOCK_METHOD1(libinput_event_pointer_get_time, uint32_t(libinput_event_pointer*));61 MOCK_METHOD1(libinput_event_pointer_get_time, uint32_t(libinput_event_pointer*));
62 MOCK_METHOD1(libinput_event_pointer_get_time_usec, uint64_t(libinput_event_pointer*));62 MOCK_METHOD1(libinput_event_pointer_get_time_usec, uint64_t(libinput_event_pointer*));
63 MOCK_METHOD1(libinput_event_pointer_get_dx, double(libinput_event_pointer*));63 MOCK_METHOD1(libinput_event_pointer_get_dx, double(libinput_event_pointer*));
64 MOCK_METHOD1(libinput_event_pointer_get_dx_unaccelerated, double(libinput_event_pointer*));
64 MOCK_METHOD1(libinput_event_pointer_get_dy, double(libinput_event_pointer*));65 MOCK_METHOD1(libinput_event_pointer_get_dy, double(libinput_event_pointer*));
66 MOCK_METHOD1(libinput_event_pointer_get_dy_unaccelerated, double(libinput_event_pointer*));
65 MOCK_METHOD1(libinput_event_pointer_get_absolute_x, double(libinput_event_pointer*));67 MOCK_METHOD1(libinput_event_pointer_get_absolute_x, double(libinput_event_pointer*));
66 MOCK_METHOD1(libinput_event_pointer_get_absolute_y, double(libinput_event_pointer*));68 MOCK_METHOD1(libinput_event_pointer_get_absolute_y, double(libinput_event_pointer*));
67 MOCK_METHOD2(libinput_event_pointer_get_absolute_x_transformed, double(libinput_event_pointer*, uint32_t));69 MOCK_METHOD2(libinput_event_pointer_get_absolute_x_transformed, double(libinput_event_pointer*, uint32_t));
6870
=== modified file 'tests/mir_test_doubles/mock_libinput.cpp'
--- tests/mir_test_doubles/mock_libinput.cpp 2015-12-07 01:13:18 +0000
+++ tests/mir_test_doubles/mock_libinput.cpp 2015-12-14 08:54:29 +0000
@@ -152,11 +152,21 @@
152 return global_libinput->libinput_event_pointer_get_dx(event);152 return global_libinput->libinput_event_pointer_get_dx(event);
153}153}
154154
155double libinput_event_pointer_get_dx_unaccelerated(libinput_event_pointer* event)
156{
157 return global_libinput->libinput_event_pointer_get_dx_unaccelerated(event);
158}
159
155double libinput_event_pointer_get_dy(libinput_event_pointer* event)160double libinput_event_pointer_get_dy(libinput_event_pointer* event)
156{161{
157 return global_libinput->libinput_event_pointer_get_dy(event);162 return global_libinput->libinput_event_pointer_get_dy(event);
158}163}
159164
165double libinput_event_pointer_get_dy_unaccelerated(libinput_event_pointer* event)
166{
167 return global_libinput->libinput_event_pointer_get_dy_unaccelerated(event);
168}
169
160double libinput_event_pointer_get_absolute_x(libinput_event_pointer* event)170double libinput_event_pointer_get_absolute_x(libinput_event_pointer* event)
161{171{
162 return global_libinput->libinput_event_pointer_get_absolute_x(event);172 return global_libinput->libinput_event_pointer_get_absolute_x(event);
163173
=== modified file 'tests/unit-tests/input/evdev/test_libinput_device.cpp'
--- tests/unit-tests/input/evdev/test_libinput_device.cpp 2015-12-07 01:13:18 +0000
+++ tests/unit-tests/input/evdev/test_libinput_device.cpp 2015-12-14 08:54:29 +0000
@@ -292,8 +292,12 @@
292 .WillByDefault(Return(event_time));292 .WillByDefault(Return(event_time));
293 ON_CALL(mock_libinput, libinput_event_pointer_get_dx(pointer_event))293 ON_CALL(mock_libinput, libinput_event_pointer_get_dx(pointer_event))
294 .WillByDefault(Return(relatve_x));294 .WillByDefault(Return(relatve_x));
295 ON_CALL(mock_libinput, libinput_event_pointer_get_dx_unaccelerated(pointer_event))
296 .WillByDefault(Return(relatve_x));
295 ON_CALL(mock_libinput, libinput_event_pointer_get_dy(pointer_event))297 ON_CALL(mock_libinput, libinput_event_pointer_get_dy(pointer_event))
296 .WillByDefault(Return(relatve_y));298 .WillByDefault(Return(relatve_y));
299 ON_CALL(mock_libinput, libinput_event_pointer_get_dy_unaccelerated(pointer_event))
300 .WillByDefault(Return(relatve_y));
297 }301 }
298302
299 void setup_absolute_pointer_event(libinput_event* event, uint64_t event_time, float x, float y)303 void setup_absolute_pointer_event(libinput_event* event, uint64_t event_time, float x, float y)

Subscribers

People subscribed via source and target branches