Update 9-Jul-2021: This issue appears to have been resolved with macOS version 11.4. I am no longer experiencing the problem after this update.
Since upgrading to Big Sur I have been experiencing, sometimes multiple times per day, an issue where after waking the machine from sleep:
I am unable to enter text input with the keyboard. Typing into text inputs produces the system alert sound, as if typing is not allowed. Some shortcut combinations like Cmd+Tab still work. Using the on-screen keyboard produces the same results, so it appears not to have anything to do with the keyboard hardware.
I am unable to click on some kinds of UI controls with the mouse. Clicking on a window will bring it to the foreground. But links on webpages have to be double-clicked to navigate, as if the first click is ignored. Other kinds of controls such as the sidebar in Finder don't respond to clicks at all.
When clicking between windows belonging to different apps, the active app in the system menubar does not update. So I may have a Finder window in the foreground, but Chrome's menu will still appear in the menubar.
If I switch to a different desktop space, a different app may appear in the menubar (depending on what is open in that space) but then the menubar becomes complete unresponsive and does not respond to clicks after that.
It's obvious when looking at some apps like System Preferences or Activity Monitor that even when their window has been brought to the foreground, the app isn't fully "focused", as some controls remain greyed out in the way they do when the app is in the background. (I think this gives a big clue about what's going on - is something stealing focus and won't allow any other app to be focused?).
Putting the machine back to sleep does not resolve the problem, it remains in the same broken state after waking again. Using fast user switching to jump to another user profile reveals the other profile to be unaffected, but switching back to the first user returns it still in the broken state.
I have tried force quitting Finder and sending kill signals to
Dockprocess, but this has no impact.
The only solution I have found is to log out and log in again, or restart. Sometimes it is not even possible to log out, as the menubar may become unresponsive and the Cmd+Shift+Q shortcut doesn't always work, in which case a forced restart from the Login Window is required (the Login Window itself behaves normally throughout).
This issue began immediately after upgrading to Big Sur, so I think it must be a macOS bug - but as I have been unable to locate any other reports of this issue by Googling all the terms I can think of, it is conceivable that the problem results from a particular combination in my system of third-party apps or peripherals.
My machine is a MacBook Pro (16-inch, 2019) with i9 and Radeon Pro 5500M. Running Big Sur 11.0.1. I usually have a Thunderbolt 3 dock attached with external display, USB keyboard and mouse, but the problem has also occurred when roaming with nothing plugged in.
Going with the focus-stealing theory, is there a way to debug this by determining which process owns the currently focused app/window in macOS? (I am able to run terminal commands by ssh'ing in from another machine when the problem occurs.)
Alternatively, is this a known issue or has anybody else experienced this? Are there other solutions or workarounds I can try to resolve the problem without logging out?