protonscr

Electron behave when Steam is running

steamopen Web Component
ValveSoftware/steam-for-linux#9121 · opened 2023-01-19 by gnolooo · updated 2023-03-28 · 8 comments · github
Ggnolooo 2023-01-19 github

Your system information

  • Steam client version (build number or date): 1.0.0.75
  • Distribution (e.g. Ubuntu): Arch Linux
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

I don't really know if Steam client for Linux is based on Electron or not, but I've noticed that whenever I open Steam, my electron apps starts to behave in a weird way.

For example, I use an electron-based WhatsApp client (https://gitlab.com/zerkc/whatsdesk) that can, as a feature, be closed to tray instead of being killed when closed. This allows me to close the main window keeping the process running in background so I can still receive messages, notifications etc.

Now, when Steam is running alongside WhatsDesk with the latter being closed to tray but running (check under for detailed steps - this works even if I close Steam, leading me to think this isn't related to Steam being running but just being launched), if I launch WhatsDesk it doesn't resume the closed-to-tray task but it starts a brand new session where I even have to re-do the login. I know it doesn't sound like a Steam problem but this happens only when Steam is running, and not when other Electron apps are.

Steps for reproducing this issue:

  1. Launch WhatsDesk
  2. Close WhatsDesk to tray
  3. Launch Steam (doesn't matter if it's running or not, the issue is related to the launch of the app)
  4. Re-launch WhatsDesk

Screenshots:

2023-01-19_16-47

  1. WhatsDesk running in both window and tray

2023-01-19_16-49
2. Steam running as well

2023-01-19_16-56
3. Steam closed (doesn't matter if running in tray or not) and duplicated WhastDesk session. You can see the left one has even the icon of a new message, meaning that one is the old one and it's still running, but I also has a new session where I'm logged out

Ddawaltconley 2023-03-22 github

I have the same problem, on Pop!_OS 22.04 and electron apps like Slack. Just opened an issue, see there for steps to reproduce. I ended up switching to the Steam flatpak for the moment, as this problem only seems to affect the official deb install.

Possibly related to Gnome / Pop Shell, which it looks like you're running @gnolooo?

Ggnolooo 2023-03-23 github

Yes, I'm running Arch w/ Gnome. The only difference is that it's not Steam deb but Steam on the multilib repository (though it may be it's just a port for Arch based on the deb package).

Ttejing1 2023-03-25 github

Same issue with https://github.com/Jelmerro/Vieb on nixos/i3. strace reveals the culprit is steamwebhelper. It seems like on startup it just obliterates anything that looks like an electron singleton cookie from /tmp. Somebody probably wrote some "temporary" code that didn't turn out to be so temporary... or forgot that steam isn't the only electron app in existence.

If you start the electron app after steam starts, it does seem to operate correctly until steam restarts, though.

As for why it doesn't affect the flatpak, I'd guess it's because the sandbox is preventing it from touching (and possibly seeing) what it shouldn't in /tmp.

Ggnolooo 2023-03-25 github

That actually makes sense, shout out to you for troubleshooting it.
Though, why when I start WhatsDesk (my example electron app) from tray it works? Maybe because that function does not rely on /tmp?

Ttejing1 2023-03-25 github

Yes. Opening the window through the tray icon happens internally to the running instance, since the tray icon is part of the running instance. What steam's misbehavior affects is the ability for the program to find the running instance when started independently.

Ggnolooo 2023-03-26 github

Understood, thanks. And thanks again for your collaboration.
Now, do you know where to put your hands and try to maybe solve it and make a pull request to the developer(s)?

Ttejing1 2023-03-27 github

Afaik the relevant code is closed-source, I'm afraid. It's all up to them.

Ggnolooo 2023-03-28 github

Well, let's hope this will be fixed then. Thanks again for your amazing job.

Nothing extracted yet.