Location Menu is stealing X11 focus
I am a frequent user of X11 forwarding (XQuartz 2.7.11) via ssh on macOS 11.12. However, my remote X11 applications tend to randomly lose focus. This is especially egregious when typing into my emacs, and suddenly the character stream ends up in a completely different and unrelated window.
Thanks to a helpful short python script called watch_activations.py I have been able to track down the loss of focus to the 'Location Menu':
2017-05-24 11:20:19.261 Python[48578:3102543] activated XQuartz (org.macosforge.xquartz.X11)
2017-05-24 11:20:36.543 Python[48578:3102543] activated Location Menu (com.apple.locationmenu)
I deactivated the location menu service in my preference, and we'll see how it goes from there. However, loss of all location services seems to be an unsatisfactory solution. Why is the 'Location Menu' stealing my focus in the first place when there is not even an open window to its name? Could it be that the 'Location Menu' was triggered by another application?
One more thing: Before you bring up Google Chrome and its software updater (keystone) as leading cause of stealing X11 focus - I ensured that Google's software updater is thoroughly disabled. I checked with launchctl that there were no remnants lurking. While I do have a Chrome open most times, the loss of focus shows to be associated with a different entity. (Though I won't rule out an indirect trigger.)
I will continue to run the activation watcher to see, if there are more entities stealing focus.
MacBook Pro, macOS Sierra (10.12), MacBookPro8,2 2.2GHz qc-i7 8GB