Replaces use of (now removed) MetaX11Display focus API (which happened to work for wayland too). !378