@@ -20,6 +20,7 @@
20import logging
20import logging
21import subprocess
21import subprocess
24# This has to work in both python 3 (ap 1.5) and py2 (ap legacy 1.4.1) so we
25# This has to work in both python 3 (ap 1.5) and py2 (ap legacy 1.4.1) so we
25# pick the correct location in each case. Remove the py2 branch once we no
26# pick the correct location in each case. Remove the py2 branch once we no
@@ -82,22 +83,16 @@ def unlock_unity(unity_proxy_obj=None):
82 if greeter.created is False:
83 if greeter.created is False:
83 raise RuntimeWarning("Greeter appears to be already unlocked.")
84 raise RuntimeWarning("Greeter appears to be already unlocked.")
85− # Because of potential input jerkiness under heavy load,
86+ bus = dbus.SessionBus()
86− # retry unlocking the greeter two times.
87+ dbus_proxy = bus.get_object("com.canonical.UnityGreeter", "/")
87− # https://bugs.launchpad.net/ubuntu/+bug/1260113
92− greeter.swipe()
89+ dbus_proxy.HideGreeter()
93− except AssertionError:
90+ except dbus.DBusException:
97− logger.info("Failed to unlock greeter, trying again...")
91+ logger.info("Failed to unlock greeter")
94+ greeter.wait_unlocked()
99− logger.info("Greeter unlocked, continuing.")
95+ logger.info("Greeter unlocked, continuing.")
103def lock_unity(unity_proxy_obj=None):
98def lock_unity(unity_proxy_obj=None):