Add idle event to AppKit

Originator:keithbsmiley
Number:rdar://26886501 Date Originated:19-Jun-2016 22:51
Status:Open Resolved:
Product:OS X SDK Product Version:OS X 10.11.5
Classification:Enhancement Reproducible:Always
 
Summary:
Currently if you would like to know that the system has become "idle". You have to do this manually. Current approaches include call `+[NSEvent addGlobalMonitorForEventsMatchingMask:handler:]` and start a time each time an event fires or calling `CGEventSourceSecondsSinceLastEventType` occasionally. Both of these can be error prone and don't really provide a unified solution for apps to be able to share the concept of "idle" time. Looking into the private AppKit headers it looks like _NSIdleTimer exists probably for a similar reason.

Steps to Reproduce:
1. Attempt to determine when the machine has become idle

Expected Results:
There is a centralized way to do this, possibly with a notification from NSWorkspace's notificationCenter

Actual Results:
You have to implement a solution similar to the ones mentioned above.

Version:
OS X 10.11.5

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!