@kugel- Bases on e.g. [here](https://wiki.archlinux.org/title/Xephyr): _"Xephyr is a nested X server that runs as an X application."_ So using that would require an existing X server in the first place?
At any rate, I think such an approach can be a good solution and it's good that you do this, it's just overkill to add downstram just for that one test.
I proposed an implementation of what I had in mind [here](https://github.com/geany/geany/pull/3676) and hope it could be considered :) For the time being, I am probably going to explicitly skip the test in nixpkgs.