top | item 23359820

Apple Mail randomly becomes the frontmost application in macOS

278 points| dewey | 5 years ago |annoying.technology

175 comments

order
[+] vladharbuz|5 years ago|reply
I've had this issue for the past 2–3 years. It seems to happen because of improper error handling. If you look closely at the app in the instant it opens, your affected account will have a “disconnected” symbol next to it in the sidebar. However, it goes away before an error can be shown.

My theory is: there is a momentary connection issue with these G Suite accounts, and Mail.app starts to show an error by focusing itself, but the error is resolved so quickly it doesn't actually get to show the “connection problems” modal.

I hope this can be fixed soon, it's been a daily annoyance for me for a long time now.

[+] mihaaly|5 years ago|reply
I confirm your observations.

Yet, to force an app to the front when glitch in connection happens is more like a feature they deliriously thought is being useful, instead of choosing other means of notifications, which is plenty. An app is not forcing itself to the front without someone is specifically writing the code for it to do.

[+] evanelias|5 years ago|reply
In my experience, if you always hide the Mail window (cmd-h) instead of closing it (cmd-w), it won't ever pop back up. Takes a while to retrain the muscle memory though!

I haven't tested this in Catalina, but it definitely works consistently in Mojave.

[+] dingdingdang|5 years ago|reply
Solidly on Linux Mint now but back in the day when wrangling MacOS I used Hammerspoon to fix these sort of issues - should be doable to monitor and enforce the background status of Mail.app and then pause the monitoring when invoked by user (easiest thing would likely be to set hotkey that then also pauses monitoring), and finally resume monitoring when Mail.app goes to background (i.e. user done with active interaction).
[+] Wowfunhappy|5 years ago|reply
Yep, that's exactly it.

The author's assessment is incorrect btw, this happened to me frequently for years on a computer without any G suite accounts. On a High Sierra machine fwiw.

Now I'm running Mavericks and it never happens.

[+] hnarayanan|5 years ago|reply
You are right. This has been going on for a few years, and it is related to the need for the app to display the connection error.

I find myself quitting mail when I want to be in the zone because otherwise this random behaviour is really annoying.

[+] m463|5 years ago|reply
Might be a "dogfooding it" sort of thing, where if apple employees could use google mail accounts, it might have a higher chance of being caught.

I would bet you couldn't use gmail from within the apple campus.

[+] e40|5 years ago|reply
It boggles the mind that this issue hasn't been found and fixed by now.
[+] dzhiurgis|5 years ago|reply
I’ve noticed only when watching YouTube in full screen
[+] _qulr|5 years ago|reply
My workaround for this issue is to put Mail app in its own dedicated Space/Desktop. Then it only comes to the front in its own Space, not in the Space I'm normally using.
[+] nextos|5 years ago|reply
I've switched back to a new MacBook, temporarily due to COVID as it was easy to purchase from Apple and it was an emergency.

I used OS X fulltime 2006-11. I'm surprised how buggy Catalina is, including Mail.app. I have had serious firmware issues too, such as needing to reset my SMC very frequently because my USB C stops charging the machine every other day. Apple is clearly, sadly, neglecting mac OS.

Surprisingly, I haven't disliked butterfly keys as much as I thought I would do. I can type extremely fast. I do prefer their scissor keys, though, which are really good and low latency [1].

[1] https://danluu.com/keyboard-latency/

[+] elmcrest|5 years ago|reply
good to know as a workaround, thx
[+] jtlowe|5 years ago|reply
I experience this as well after upgrading to Catalina. I thought it was my fault at first, caused by some sort of key combo. It only happens for me when in full screen with another app.

I use Mail with a GSuite account as well.

[+] mihaaly|5 years ago|reply
I am still not on Catalina yet and it started for me ca. 6-9 months ago. Perhaps with some Mojave update. (unsure as no big changes occurred and it took some time to see being a systematic trouble)

I am more and more turning off system updates (not only Mac) as those bring more trouble than good. Being a very late adopter pays off. (update to Catalina is still not in the middle term plans)

[+] holstvoogd|5 years ago|reply
Pretty sure it is due too it not being able to connect to a mail server. every time it happens, i see the "couldn't connect" icon
[+] galad87|5 years ago|reply
Yes, that's it. It happened with my Gmail account too, it stopped when I removed it from Mail.
[+] auggierose|5 years ago|reply
Yeah, it is horrible. I am closing Apple Mail when I am not using it because of it.
[+] 7ewis|5 years ago|reply
Something I still don't understand, similar to this - not sure if it's a bug or feature but I use Desktops heavily, especially while working at home without my extra monitors.

For some reason, the order of my Desktops on Mac seem to reshuffle, I can't work out what causes it or when it happens. I often have it ordered something like this:

Desktop 1 - Google Doc (Chrome)

Desktop 2 - Researching (Chrome)

Desktop 3 - Slack

Desktop 4 - Spotify

I'll do the three finger gesture moving from Desktop 1 to 2 and randomly say Spotify will have moved there. It's so annoying.

[+] TacticalTable|5 years ago|reply
When you go into preferences > Mission Control, is 'Automatically rearrange Spaces based on most recent use' checked? I used to hate spaces until I turned that off.
[+] theDoug|5 years ago|reply
The answer is found in System Preferences > Mission Control. Uncheck the “Automatically rearrange spaces based on most recent use” box :)
[+] jpxw|5 years ago|reply
I have no idea why this is a default feature on OS X. It's one of the very rare moments where I think they've got a design decision totally wrong.
[+] clairity|5 years ago|reply
has anyone found a good, free solution for naming spaces (instead of “Desktop n”)? i used to be able to name them with a free utility, but SIP killed it.
[+] mstade|5 years ago|reply
I don't have any issues with Apple Mail but I do have issues with zoom, randomly switching from full screen sharing to the desktop and back again, it's incredibly annoying. It doesn't happen when I share my screen, only when others do. It seems to have gotten better recently but still happens in occasion. Anyone else seeing this? Maybe it's related?
[+] vladnyc|5 years ago|reply
It’s a setting you can turn off
[+] gingerlime|5 years ago|reply
I have another zoom problem on Mojave. Even though I marked the zoom windows to use Desktop 2, they keep opening on Desktop 1 :-/ any tips on how to fix this?
[+] brandonhorst|5 years ago|reply
You can fix this by removing the “Google” account and connecting to Gmail as a regular IMAP account.

Since I did that, I haven’t had any issues with this.

[+] nottorp|5 years ago|reply
Oh, I was wondering why I don't have that issue. I've set up Apple Mail long before they had specific support for "google" accounts so of course the gmail account is imap...

Btw 7 years of importing application configuration across OS installs without a hitch.

[+] rinaldsarins|5 years ago|reply
I have the same issue, in fact I'm so used to it that I even do not notice it anymore, except when watching fullscreen video, then I'm like: "It's just the way how things are here...[quits Mail]".

As someone already mentioned - I'm also pretty sure it's related to some disconnect/reconnect thing.

[+] Veen|5 years ago|reply
This has been annoying me for months. It’s particularly irritating when you’re screen sharing. I just make sure Mail is quit when I’m not using it, which isn’t ideal.
[+] kristofarkas|5 years ago|reply
How is it that there is still no known root cause for this issue? I suspect there is a way to check what the reason an app came to the foreground is, no?
[+] galad87|5 years ago|reply
The reason is that Mail thinks the mail server is unreachable, so it brings the window to front, but then magically it changes idea and the mail server is reachable again ️.
[+] mihaaly|5 years ago|reply
I hint that the root cause is a stupid design decision. Forcing the app into the front, for whatever reason. Without the means to turn the behaviour off.
[+] knolan|5 years ago|reply
I’ve had this issue for a long time now across a couple of versions of MacOS and three Macs. It appears to be related to Google Calendar. My current workaround is to hide a Mail window with CMD-h. I’ve given up trying to report it or find a fix.
[+] evanelias|5 years ago|reply
Can confirm, same here. As long as you hide the window (cmd-h) instead of closing it (cmd-w), the problem doesn't ever come up. I've been using this work-around for over a year now.
[+] gnicholas|5 years ago|reply
Another Mail issue I have: if one mail message is highlighted and then I click another and type command-R to reply, the email reply will be to the message that is no longer selected. Sometimes I’ll get a notification of a new email, go to click and send a quick reply (“ok great”), and I’ll have sent the email before I realize that it’s going to the wrong recipient.

It seems crazy to me that the order of operations can be messed up like this. First I clicked, then I command-R’d. Why would Mail handle these commands out of order?

[+] demarq|5 years ago|reply
I switched to Airmail for only this reason lol
[+] dmitriid|5 years ago|reply
When I tried Airmail, they sent an email that had something like "oh, we see that you use @<domain>.com. Do you think you could reach to your colleagues and talk to them about using Airmail". I deleted the app immediately.
[+] kahlonel|5 years ago|reply
I was a long time Gmail user, on the verge of leaving Gmail due to a long list of reasons. This bug was the final straw for me (I know it’s not Gmail’s fault). Got rid of Gmail completely. Haven’t seen this bug since.
[+] deergomoo|5 years ago|reply
I’m not sure why but Google services seem to cause a lot of issues on the Mac. I don’t use Google-based calendars anymore, but when I did, the accountsd process would often sit chewing absurd amounts of CPU for no discernible reason.

Same goes for this Mail issue, it only seems to happen with Gmail/G Suite accounts.

But yes, I am also looking to move away from Gmail; not because of this bug but because I don’t like the idea of all my important online accounts being tied to a company that has essentially zero customer service or support.

[+] basilgohar|5 years ago|reply
Gmail's IMAP interface does have issues, along with their repurposing IMAP folders as "labels", this causes many traditional email clients problems, including Thunderbird. My Gmail account causes Thunderbird to slow to a crawl most times. I am sure there is some Thunderbird liability as well, but I did not have this problem with other, large IMAP accounts that were not Gmail before.
[+] saagarjha|5 years ago|reply
Interestingly, I have the opposite problem: when I boot up my computer Mail shows now windows until I click on it, even though every other app restores its windows. Very strange.
[+] egypturnash|5 years ago|reply
I get something like this all the time, except it pops up behind whatever I'm doing and doesn't steal focus. I also almost never do stuff in full screen mode, maybe that's the trigger for it stealing focus?

Definitely seems to be related to "I had an email connectivity error and I must let you know NOWNOWNOW." Knowing that it's associated with gmail accounts feels like one more reason for me to get off my ass and disentangle my email from gmail...

[+] bondolo|5 years ago|reply
If you have Microsoft Exchange accounts then you get a different bug. If you have no network connection or change network connections Apple Mail will thrash accountsd for long periods of time consuming as much of the CPU as it can. Neither Apple Mail nor accountsd appear to have any throttling of network connection attempts. Quitting Apple Mail until you have a network connection is the only option.