GTK application launched in Xorg session connects to a Wayland server instead
Steps to reproduce
- Run any Xorg-based session (I used fluxbox, but GNOME should do)
- Start gtk3-demo
- Quit the gtk3-demo
- Open Weston (nested, in a window)
- While Weston is running, start gtk3-demo in the Xorg session again.
Current behavior
gtk3-demo from step 2 appears in Xorg.
gtk3-demo from step 5 appears in Weston.
Expected outcome
gtk3-demo from step 5 should appear the same way as in step 2, in Xorg, not in Weston.
Version information
GTK 3.24.5-1, Debian Buster
Additional information
This is essentially a rerun of #1224, but this time only describing the problem, not proposing (false) solutions.
The general question here is, how should applications figure out how to connect to a display server?
What should display servers do, if anything, to facilitate it?
The purpose of this issue is to find out a preferred common way for all toolkits, GTK included, to figure this out correctly. It does not matter if it works with Fluxbox or Weston as is, as long as there is an agreed design on how it could be made to work.
This is filed as a GTK issue, because apparently GTK is the odd toolkit out in this respect, or at least others seem to have agreed to a solution that GTK developers have refused - a solution that I hear even gnome-shell has opted to support.