]> git.neil.brown.name Git - plato.git/commitdiff
lock: bugfix relating to recent changes to stopping alerts
authorNeilBrown <neilb@suse.de>
Thu, 19 Dec 2013 04:17:45 +0000 (15:17 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 19 Dec 2013 04:17:45 +0000 (15:17 +1100)
utils/lock.py

index a3aa82a477095a8b88321c148b1123c309911465..f33d037c455df223b5d2c40c3863ed77700007a8 100755 (executable)
@@ -354,7 +354,7 @@ def wake_all(down_cnt, moment, typ, code, value):
         return
     if suspended:
         return
-    if type == 1 and code != 330:
+    if typ == 1 and code != 330:
         # EV_KEY but not BTN_TOUCH
         alert.stopall()
     display.on()
@@ -377,12 +377,13 @@ def wake_dim(down_cnt, moment, typ, code, value):
         wake_all(down_cnt, moment, typ, code, value)
 
 def wake_toggle(down_cnt, moment, typ, code, value):
-    global state, last_set, enable_suspend, suspended
+    global state, last_set, enable_suspend, suspended, alert
     if suspended:
         return
     # ignore down, just get up
     if typ != 1 or value:
         return
+    alert.stopall()
     if ( state == "full" or state == "disable" ) and get_ticks() - last_set > 0.5:
         enable_suspend = True
         last_set = 0