Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from josh/detect-display-sleep
Browse files Browse the repository at this point in the history
Check CGDisplayIsAsleep on tick to reset timer
  • Loading branch information
josh committed Feb 13, 2016
2 parents 2541bd0 + 7931b72 commit 19f202c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Aware/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if (sinceUserActivity > userIdleSeconds) {
timerStart = NSDate()
idle = true
} else if (CGDisplayIsAsleep(CGMainDisplayID()) == 1) {
timerStart = NSDate()
idle = true
} else {
idle = false
}
Expand Down

0 comments on commit 19f202c

Please sign in to comment.