Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Posted on May 24, 2017 11:43 AM

Reply
Question marked as Best reply

Posted on Jun 4, 2017 2:07 PM

I am having the same problem with x2go (fork of old NX) which uses XQuartz and X forwarding. The Location Menu was also the culprit in my case. I'll follow your lead and disable location services but second your sentiment that this is a suboptimal solution. I don't recall this happening until recently which may point to some recent software update.

5 replies
Question marked as Best reply

Jun 4, 2017 2:07 PM in response to YasonX

I am having the same problem with x2go (fork of old NX) which uses XQuartz and X forwarding. The Location Menu was also the culprit in my case. I'll follow your lead and disable location services but second your sentiment that this is a suboptimal solution. I don't recall this happening until recently which may point to some recent software update.

Nov 10, 2017 9:26 AM in response to YasonX

I have the exact same problem. I use XQuartz a lot and this is incredibly annoying. I also have a python script running that identifies Location Menu as the culprit. I noticed similar problems in the past but they were infrequent enough to ignore, like once a day or less. This seems to have escalated since a recent update; I'm on Sierra 10.12.5. Now I'm seeing it many times per hour. I personally don't think any app should be able to steal focus, but that's just my opinion. In this specific case, I see no need for Location Menu to be stealing focus and certainly not as often as it is. If something needs to run periodically to check the current location (just guessing) couldn't that be a separate, non-gui process that stores the information somewhere that Location Menu could access when it needs it? It seems like there would be several ways to implement this that would not include stealing focus.


Sorry I couldn't help, YasonX. But I at least wanted someone to know that you are not suffering alone.

Nov 10, 2017 9:32 AM in response to YasonX

I turned on location services back on, and it's still an issue in 10.13.1.


The location icon in the menu bar shows "setting time zone" as the last user when focus was stolen. Strangely enough, I had disabled that system service this morning, yet it still steals my focus. Alternatively, something else might be stealing focus. I wish there was a decent solution to this annoying issue.

Nov 15, 2017 6:30 PM in response to mjbeal

I ran for a while with "Location-Based Suggestions", "Setting Time Zone", and "Significant Locations" disabled (unticked). Yet, my X11 focus was still stolen, and according to the Dock's location icon, it was "Setting Time Zone" (which was unchecked) that cause the Location services to trigger. I filed a bug report with Apple.

Location Menu is stealing X11 focus

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.