FWIW, here is a patch which causes Emacs to check that at least one of the environment variables WAYLAND_DISPLAY, DISPLAY, BROADWAY_DISPLAY is set before it will try to use PGTK for its initial window. This patch is not suitable for merging, because it doesn˘t consider what happens if you try to use PGTK on Windows or MacOS. However, people might find it useful if they˘re not using one of those platforms. This patch depends on the patch for bug 72118. -- Peter Oliver