26
16
The active window on my machine occasionally loses focus. The active app remains the same -- if I was in Chrome before, I'm still in Chrome now -- but the active window is no longer active. No window is active. This is frustrating; it happened while typing this question, and my keystrokes suddenly stopped registering.
I believe that some other app is stealing focus, but that it itself has no UI to display, so the active window becomes not active, but the active app remains active.
The question is: How do I track down the offending app, so that I can angrily delete it? Normally in cases of focus theft, the culprit is obvious, because it has focus. In this case, I'm stumped.
Worked great. AirServer was stealing my focus. WHY!!!! – Michael Potter – 2019-04-24T23:14:06.827
You could try the
Apple > Force Quit...menu to see if there is anything running that shouldn't be. – Michael Frank – 2014-03-26T21:18:59.7301@MichaelFrank It won't show applications that have no menu bar (e.g. those with
LSUIElementset totrueinInfo.plist). Those are perfectly capable of that behavior. – Daniel Beck – 2014-03-27T00:08:45.383@DanielBeck Ahh, gotcha. That's handy to know. – Michael Frank – 2014-03-27T00:09:56.750
1
FYI, I asked basically this same question on Apple SE: Is there a way to detect what program is stealing focus on my Mac?
– Kevin Reid – 2014-03-27T00:12:07.030tell application "System Events" to display alert ((name of first application process whose frontmost is true) as string)unfortunately does not consider processes without menu bar. – Daniel Beck – 2014-03-27T00:15:19.213Does searching the list of applications started on login help? System Preferences » Users & Groups » (Your Username) » Login Items – Daniel Beck – 2014-03-27T00:16:17.027
@KevinReid thanks! Sad to see no ready answers. – Josh Bleecher Snyder – 2014-03-27T19:17:20.027
@DanielBeck this is a work laptop. It has all kinds of stuff running on it, many of them installed not by me. I'm afraid that inspection is unlikely to reveal the answer I need. I looked at the Login Items, but they all have a menu bar. I suppose I could write a script to trawl through my hard drive, parse
Info.plistforLSUIElementset tofalse, and start there... – Josh Bleecher Snyder – 2014-03-27T19:20:40.870