Merge lp:~mzanetti/autopilot/dont-use-touchpad-for-touch into lp:autopilot

Proposed by Michael Zanetti
Status: Merged
Merged at revision: 559
Proposed branch: lp:~mzanetti/autopilot/dont-use-touchpad-for-touch
Merge into: lp:autopilot
Diff against target: 43 lines (+3/-10)
1 file modified
autopilot/input/_uinput.py (+3/-10)
To merge this branch: bzr merge lp:~mzanetti/autopilot/dont-use-touchpad-for-touch
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Autopilot Hackers Pending
Review via email: mp+264011@code.launchpad.net

Commit message

Don't use BTN_TOOL_FINGER but BTN_TOUCH instead.

BTN_TOOL_FINGER results in evdev registering a Touchpad device, which in turn causes unity8 to switch to windowed mode. BTN_TOUCH instead registers a Touchscreen device, which is the more proper thing to do anyways.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
560. By Michael Zanetti

fix flake issue, rename all instances

561. By Michael Zanetti

use _get_touch_tool everywhere

562. By Michael Zanetti

no self

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/input/_uinput.py'
2--- autopilot/input/_uinput.py 2015-03-16 15:14:27 +0000
3+++ autopilot/input/_uinput.py 2015-07-07 22:12:51 +0000
4@@ -23,7 +23,6 @@
5
6 from evdev import UInput, ecodes as e
7
8-import autopilot.platform
9 from autopilot.input import Keyboard as KeyboardBase
10 from autopilot.input import Touch as TouchBase
11 from autopilot.input._common import get_center_point
12@@ -325,13 +324,7 @@
13
14
15 def _get_touch_tool():
16- # android uses BTN_TOOL_FINGER, whereas desktop uses BTN_TOUCH. I have
17- # no idea why...
18- if autopilot.platform.model() == 'Desktop':
19- touch_tool = e.BTN_TOUCH
20- else:
21- touch_tool = e.BTN_TOOL_FINGER
22- return touch_tool
23+ return e.BTN_TOUCH
24
25
26 class _UInputTouchDevice(object):
27@@ -378,7 +371,7 @@
28 self._device.write(
29 e.EV_ABS, e.ABS_MT_TRACKING_ID, self._get_next_tracking_id())
30 press_value = 1
31- self._device.write(e.EV_KEY, e.BTN_TOOL_FINGER, press_value)
32+ self._device.write(e.EV_KEY, _get_touch_tool(), press_value)
33 self._device.write(e.EV_ABS, e.ABS_MT_POSITION_X, int(x))
34 self._device.write(e.EV_ABS, e.ABS_MT_POSITION_Y, int(y))
35 self._device.write(e.EV_ABS, e.ABS_MT_PRESSURE, 400)
36@@ -430,7 +423,7 @@
37 lift_tracking_id = -1
38 self._device.write(e.EV_ABS, e.ABS_MT_TRACKING_ID, lift_tracking_id)
39 release_value = 0
40- self._device.write(e.EV_KEY, e.BTN_TOOL_FINGER, release_value)
41+ self._device.write(e.EV_KEY, _get_touch_tool(), release_value)
42 self._device.syn()
43 self._release_touch_finger()
44

Subscribers

People subscribed via source and target branches