If Security>Require password after sleep is Enabled, focused app becomes NULL on resume blocking keyboard input

Originator:luke.hamburg
Number:rdar://50661344 Date Originated:5/10/2019
Status:Open Resolved:
Product:macOS Product Version:10.14.5
Classification:Bug Reproducible:Always
 
Summary:

If "Require password" is enabled in SysPrefs > Security > General, then upon waking the Mac from sleep/screensaver and unlocking via keyboard, the frontmost app is "NULL" and thus any keyboard input just results in a "sysbeep" until another app is clicked.

Steps to Reproduce:
1. I have a Python script that simply prints the PID, Name and Path of the focused app. Download that script here & run it from a Terminal:
https://gist.github.com/luckman212/91cdd9a08e98a9f01214bdfde3057e85 
2. Enable the "Require password" option in SysPrefs>Security. Set to "5 seconds" for testing (see screenshot)
3. Launch TextEdit and create a new document.
4. With TextEdit having focus, invoke the screensaver (using a Hot Corner is easiest)
5. Wait for the security timer to elapse (>5 seconds)
6. Tap a key to unlock the screen
7. Enter your password
8. The .py script should now show "no active app" (similar to attached screenshot) even though in the Menu bar it appears as though TextEdit still has focus.
9. Try typing - you should hear your sysbeep sound, and nothing is output in TextEdit.

Expected Results:
TextEdit should regain focus after ScreenSaver exits.

Actual Results:
"NIL" or "NULL" focusedapp.

Version/Build:
tested & reproduced on:
10.14.4 final
10.14.5 final (18F132)

Configuration:
mac Mini 2018, 32GB RAM, 1TB SSD

some more background + details at:
https://github.com/JohnCoates/Aerial/issues/768

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!