ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.17k stars 173 forks source link

Steam UI won't open from `steam.desktop` application entry on Ubuntu 24.04 using Wayland #10929

Open dPreininger opened 1 month ago

dPreininger commented 1 month ago

Your system information

Steam's UI won't open if launched from applications menu on Ubuntu 24.04 if using Wayland display server protocol. Issue was noticed AFTER I have already successfully signed in, so not sure if sign in screens and updating Steam screens are affected. The only part of the UI that opened up was "restoring your session" spinner when you initially open the app. Main screens (Store, Library, Friends,...) don't open. Pretty sure the problem is also present if you install Steam via Snap as that installation also wasn't working but I didn't troubleshoot why. Not sure if it affects any other distributions on Wayland, such as Fedora for example.

I believe xdg-open is not working properly (I didn't check if it might be unsupported on Wayland), because if I remove steam.desktop file from my ~/.local/share/applications, then everything works as it should, because it reverts back to "Install Steam" application entry from /usr/share/applications, where the line telling the system to interpret the file using xdg-open (the line is: #!/usr/bin/env xdg-open) is not present.

Workaround for those affected by this issue (paste these lines into the terminal):

  1. make sure you have installed steam using apt and not snap
  2. rm ~/.local/share/applications/steam.desktop
  3. cp /usr/share/applications/steam.desktop ~/.local/share/applications/
  4. sed -i -e 's/Install Steam/Steam/g' ~/.local/share/applications/steam.desktop
  5. restart the computer (or log out and log back in)

This will copy over the "Install Steam" application entry (which, as described above, works without problems) from your root applications folder and rename it to "Steam" to avoid confusion. Don't worry, this won't try to reinstall Steam every time you open up the app.

Steps for reproducing this issue:

  1. Have correct OS, distro and display server protocol
  2. Install Steam (installer) using apt
  3. Install Steam using the installer
  4. Launch Steam using application entry or terminal (at this point, application entry should still work) and sign in
  5. Restart the computer (or log out and log back in) to trigger the reading of your .desktop files
  6. Launch Steam using application entry (at this point it shouldn't work anymore)
xrogaan commented 1 month ago

I don't know if it's a wayland problem. I had the steam UI not appear at all on startup while running Xorg as display server. The only thing that would appear was the system tray icon. But even that wouldn't get steam to shutdown. Killed it, restarted it, and it displayed correctly. This behavior only happened once, so unsure how to reproduce.

restart the computer (or log out and log back in)

Why would restarting the computer be necessary for a .desktop change? (Is it a GNOME thing?)

dPreininger commented 1 month ago

I don't know if it's a wayland problem.

That is good to know. Maybe the version of xdg-open that is bundled with 24.04 doesn't support commands defined in .desktop file of installed Steam?

What version of what OS are you running @xrogaan? Did the posted workaround work for you? (you can also try to run command steam from terminal, if that works, the workaround should also work for you)

Why would restarting the computer be necessary for a .desktop change? (Is it a GNOME thing?)

Simply editing .desktop file is not enough, the .desktop files also need to be reloaded by your system to update application menu entries. I am sure there are many ways to do so, but I think the easiest is to log out and log back in. I suggested restarting so people wouldn't potentially get confused and think you need to log out of Steam and log back in.

I don't know whether .desktop files are "watched" and reloaded automatically after changes on other desktop environments, such as KDE.

xrogaan commented 1 month ago

Did the posted workaround work for you?

I already stated in my comment, it was a one time problem. Might not be related to yours at all, if you can reproduce the behavior on your end. I'm running Devuan, just your regular debian stable without systemd.

Said workaround wouldn't solve any issue on my end, as both desktop files contain the same exec entry.

What I suspect happened, but too lazy to verify, is that I shutdown my computer without closing steam first. KDE might try to restart previously running software, and in this case it may have failed.

I don't know whether .desktop files are "watched" and reloaded automatically after changes on other desktop environments, such as KDE.

They are. KDE watches specific directories for changes and update the various menu automatically. At least, that's my experience.

itsryzor commented 1 month ago

I had an identical problem to the one described immediately upon upgrading to Kubuntu 24.04. The problem is that your workaround in the first post did not work. However, launching Steam from the terminal DOES allow it to function normally for some reason.

xrogaan commented 1 month ago

Launching through a terminal would have steam inherit the environment of said terminal. Though I do not know how wayland handle that.

dPreininger commented 1 month ago

I had an identical problem to the one described immediately upon upgrading to Kubuntu 24.04. The problem is that your workaround in the first post did not work. However, launching Steam from the terminal DOES allow it to function normally for some reason.

Have the commands from the workaround executed successfully? Have you perhaps installed steam through snap (or app center GUI, which would install through snap)?

To troubleshoot, you could:

  1. run which steam in terminal to see if path starts with snap (it shouldn't start with snap)
  2. run cat ~/.local/share/applications/steam.desktop and /usr/share/applications/steam.dekstop to see if the two files are identical except for the name field
itsryzor commented 1 month ago

I am not using the snap version of Steam. This problem is now fixed for me, but the fix was a bit complicated. I had to:

It's possible some or all of these steps could be skipped but that is what I did.

617a7aa commented 2 weeks ago

@itsryzor i had this same issue on fedora 40, plasma 6.1 wayland. steam from terminal opened fine but didn't work when launching as a normal UI application. the desktop file wasn't in my .local/... dir but somewhere else and used root perms to edit it. i edited it and changed PrefersNonDefaultGPU=true to PrefersNonDefaultGPU=false and now it's working fine... in case this helps anyone