Fix busy loop (sleep wouldn't be triggered when the display is off)

This commit is contained in:
Kristóf Tóth 2020-08-21 10:35:05 +02:00
parent 78c216486f
commit 48aaf76c8a

View File

@ -112,15 +112,15 @@ func (af *AfterLock) hybernateDisplayLoop() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
for { }
time.Sleep(time.Duration(af.LoopDelay) * time.Second)
if af.keypressFlag.Get() { for {
af.keypressFlag.Set(false) time.Sleep(time.Duration(af.LoopDelay) * time.Second)
continue if af.keypressFlag.Get() {
} else { af.keypressFlag.Set(false)
break continue
}
} }
break
} }
} }
} }