Repository: electron
Issue: Open On Correct Display (X11, Multiple logins, different X servers) or Always respect $DISPLAY
Labels: enhancement :sparkles:,x11



### Preflight Checklist

* [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

### Problem Description
On Linux, Atom, and VSCode both demonstrate this issue, while I don't think that eletrcon itself does, I need at least affirmation that it is a application implenetation issue and not a core electron issue.

I have this new system that I have setup the lastest Arch version, and am up to date as of today with all current versions; the behavior still exists.
 
 - Use a linux system which uses wayland, with X11 module support, for example `weston -xwayland`.  (I don't think this is a wayland issue, but that is specifically what I am using).
 - Login into the same linux system using a SSH client with X11 forwarding enabled, and the same user account.
 - start `atom` or `code` in either session.
 - start `atom` or `code` in the other session, the new session will open on the first instances' display.

Some other notes; `DISPLAY=:0`  on the wayland/native X server on the system; the local host one.  `DISPLAY=:10.0` on the SSH X forwarded login.   Although I expect this would also happen if multiple systems used the same login with X forwarding to each, since they should have a different `DISPLAY` environment setting indicating their own display.

I reported this issue https://github.com/microsoft/vscode/issues/87498  But have not approached that atom, but I got '@d3x0r does that happen with any other electron app?'  as the first response... so, it happens to be 'yes'.  Does this mean that electron isn't working by design and it's something that Atom is doing that VSCode inherited?



### Proposed Solution



### Alternatives Considered


### Additional Information
 
I recently bought this system; it's a AMD 1605B fanless box with 4 HDMI outputs.  I intend to do signage with such a system.  But during deveopment, I have a 4k Projector (AAXA 4K1) connected to it, and meanwhile I have a windows system that's my main operating terminal.  So, I have SSH connection to it for editing my code on the box natively, but then I can also recline in the comfy chairs and also do coding (the projector is native 4k, and although black on white gets lost, white on black text is entirely readable at 4K Linux default console font size.  I started 'code .' and the display didn't show up... I went to another place and started another one... eventually I got back to my windows terminal, and found that there were 3 more editors open on that system, and none on the system I launched them on.   It appears that there's a shared memory region that's (user?group?system?) shared that overrides whatever the current DISPLAY environment variable is.  
I haven't tested if I launch.... (revise). I did `xhost +` and was able to test if root on the same local display launches, the application shows up on the correct 'local' display.  So it's at least isolated by user; I was tempted to post this as a security issue....