MacOS – X11 periodically losing focus

macosx11

I have a very annoying issue with the X11 app on OS X when using it to run things remotely over SSH. Every now and then (it's pretty regular, I'd say about each 1-2 minutes), the app I'm in loses focus, and the keyboard doesn't get sent to it anymore. However, X11 is still the foreground app.

Any ideas on what could be causing this and/or how to debug this?

Best Answer

ssh: wrong culprit

I have this loss of focus on a variable frequency on XQuartz without any ssh command.

On the other hand I found a heavy relationship between this XQuartz loss of focus and the launch of:

Google Software Update (com.google.Keystone.Agent)

Analysis of this bug

2 tools help during this investigation:

  1. watch activations Python script

    [...]
    2014-07-22 17:06:04.622 Python[95279:1307] activated Google Software Update (com.google.Keystone.Agent)
    2014-07-22 17:06:08.410 Python[95279:1307] activated loginwindow (com.apple.loginwindow)
    [...]
    
  2. lastcomm | head -10 immediatly after the event →

    [...]
    diskmanage -S      root     __         0.00 secs Tue Jul 22 17:06 (0:00:18.03)
    GoogleSoft -S      root     __         0.11 secs Tue Jul 22 17:06 (0:00:30.03)
    [...]