Emacs client/daemon doesn't play well with focus stealing prevention policy
Following the suggestion in #358 (comment 551567) I'll address the specific interaction of emacs client/daemon with mutter focus stealing prevention policy.
From the point of view of the user, it should make no difference whether he/she is launching standalone emacs or emacsclient [1], be it from a terminal, from the dash or any other way. But it does a lot of difference to mutter, because emacsclient just messages its daemon instructing it to open a new window. So what the user sees as a new emacs frame (frame is emacs term for a window/client), mutter sees as a background app opening a new window. More often than not, the new emacs frame is not raised nor focused and the "Emacs is ready" message appears instead. I don't think I'm exaggerating if I say it's an important usability problem in a more or less standard configuration of a relatively popular and traditional linux application.
Now, I would like to fix it, I don't mind having to deal with emacs internals if that's necessary. But first I need to know if this client/server setting, with a server launching windows for the sake of the client (I suddenly remembered my days of urxvt/urxvtc), is fixable without modifying mutter itself. I've experimented with emacs frames that request raise & focus immediately after being created. That helps but still many "Emacs is ready" cases remain, probably mutter is being too smart regarding the precise timing of the focus change sequence between different apps, although I don't know what its heuristic is. Moreover, even if all cases were fixed by this hack, the flashy notification that pops up to immediately disappear would still look like an ugly artifact.
One obvious solution is to add a rule that looks at window hints and disables focus stealing prevention heuristics for some classes/names. I'm rather sure you won't like such an idea. So, short of that, it would be great if someone could explain me what emacs should do in order for its client/daemon frames to get focus just as if they were brand new standalone emacs frames.
[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server