on xenial help sign in
added sleep before write to uinput
commit36a297f33c5e99d517a857f5a02f617f57c25f62 authorNick Dedekind <nick.dedekind@canonical.com> dateMon 30 Mar 2015, 16:10 (12 years ago) parente436f56
1 file changed+1
tests/autopilot/unity8/process_helpers.py+1
tests/autopilot/unity8/process_helpers.py+1
@@ -94,6 +94,7 @@ def lock_unity(unity_proxy_obj=None):
9494 import time
9595 uinput = evdev.UInput(name='unity8-autopilot-power-button',
9696 devnode='/dev/autopilot-uinput')
97+ time.sleep(1) # give it some time to appear for mir.
9798 # One press and release to turn screen off (locking unity)
9899 uinput.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_POWER, 1)
99100 uinput.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_POWER, 0)