ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.25k stars 175 forks source link

Close to Tray #1025

Closed kevincox closed 7 years ago

kevincox commented 11 years ago

There have been similar reports (#11 and #270) but they have been closed because they were talking about adding a system tray icon which already exists. So to everyone who is reading this without a tray icon don't comment as it will get closed for the same reason.

Currently, when pressing the close or minimize buttons in the main steam window it causes steam to minimize. It would be nice if the minimize button retained it's current behavior while the close button closed the main window but kept it running in the tray.

Currently the only way to have steam running in the tray is by launching it as steam --applaunch $id because the window is never opened. Of course, once you open the window you have no way to close it.

I understand if this is a low priority enhancement request because it does not affect Unity but it would be a nice feature to eventually have implemented for traditional desktops. It is really annoying to have the steam window taking up space in my panel when I am not actively using it and am just keeping it open to receive notifications.

gdrewb-valve commented 11 years ago

When the Steam window is minimized where does it go? Does your window manager not support some form of display of minimized windows? The thinking behind the Steam UI is that there's an expectation minimized windows are tracked and available to the user in some way, plus then there's the app indicator icon.

kevincox commented 11 years ago

It goes to my panel.

The issue is that I don't want it taking up space there when I hit the close button. I want the window itself to be closed (while leaving the systray icon in my notification area).

Majkl578 commented 11 years ago

@gdrewb-valve: On Gnome Shell, the window minimizes (disappears), but it is still present in the overlay as an regularly opened window, same for alt+tabbing.

gdrewb-valve commented 11 years ago

Ah, I see, you don't want even the minimized form of the window. We deliberately switched the close box to minimize because of the number of people where the app indicator didn't work. If the window actually closes and there is no app indicator there's no UI at all for Steam even though it's still running, so we switched to minimizing. Unfortunately there's no way to know if app indicators are working (presence/absence is not sufficient as even if they're present they do not always work). Our hope is that the problems there will get worked out and then we can remove our workarounds and rely on the app indicator, at which point closing the window will close it.

kevincox commented 11 years ago

EDIT: Posted before I saw gdrewb-vavle's reply.

There are three states a window can be in open, minimized or shaded. Open, is as you would expect. The window is on the screen (but may be hidden below other windows). Minimized means the window exists but is not currently on the screen. And shaded is generally a window manager feature for just displaying a titlebar on the screen. All three window types are displayed in the "window buttons" type feature of a panel (a list of all windows).

What I am looking for is when I click the 'X' in the steam UI for the window actually close so that it doesn't appear in this panel.

I probably went more in depth then necessary but I was having trouble articulating.

kevincox commented 11 years ago

I see. That makes perfect sense. Is there any way that you could provide an option to make close behave properly? Even if I had to edit a config file or set an environment variable.

gdrewb-valve commented 11 years ago

OK, in the next client if you have STEAM_FRAME_FORCE_CLOSE=1 in your environment the close box will close the window instead of minimize. This is also hopefully temporary as we want to get rid of all of these oddities once we can rely on app inidicators.

kevincox commented 11 years ago

Thanks, that is awesome. I already have it set in my shortcut :D I guess this is closed then unless it happens not to work.

kevincox commented 11 years ago

I'm just confirming that this works! Thanks for all of the hard work.

LiamDawe commented 11 years ago

Hmm where do i pop "STEAM_FRAME_FORCE_CLOSE=1" as adding it to the end of my shortcut so it reads: /usr/bin/steam %U STEAM_FRAME_FORCE_CLOSE=1 Doesn't work for me.

kevincox commented 11 years ago

It is an environment variable so you have to set it one of the following ways.

STEAM_FRAME_FORCE_CLOSE=1 steam

but this might not work for shortcuts. You can work around this by calling the shell directly.

sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam'

Or you can set it in your environment.

export STEAM_FRAME_FORCE_CLOSE=1
steam

Whatever works for you.

LukasThyWalls commented 11 years ago

With the last update, in KDE, the systray icon are fully showing with image and all, but itself can't close to tray. If i opening Steam with STEAM_FRAME_FORCE_CLOSE=1 steam do it, but when i click (one, twice or all times i do) in the Steam tray icon it doesn't do anything, only do something if i open the menu with the secondary button and choose the option.

The questions:

I could create a new issue, but i think to do the questions here first and do it later if it's needed

Majkl578 commented 11 years ago

@LukasThyWalls: The variant with env variable is temporary workaround, since they're now using minimizing instead of closing (due the absence of tray icon for some people). They will change (correct) it later. Clicking on the icon doesn't do anything for me either. The menu that pops up is extremely laggy and extremely ugly. I just hope that must be some kind of joke or something… :)

gdrewb-valve commented 11 years ago

There's no firm timeframe for when STEAM_FRAME_FORCE_CLOSE will become the default behavior.

Steam doesn't define the behavior of the icon, what happens when it's clicked on is up to the window manager.

austincrft commented 11 years ago

@kevincox I can't figure out where to put the command lines you've suggested. Does it go on the "Exec=" line of the .desktop?

kevincox commented 11 years ago

Yes, but you might need to use the sh one. I'm not sure if the other one will work.

austincrft commented 11 years ago

@kevincox If I'm editing the steam .desktop, would I erase the line that says "Exec=/usr/bin/Steam %U" ?

kevincox commented 11 years ago

Changing that line to

Exec=sh -c 'STEAM_FRAME_FORCE_CLOSE=1 steam' %U

Should work.

kevincox commented 11 years ago

If anyone is interested there is now an AUR package that you can install to make this the default.

https://aur.archlinux.org/packages/steam-closetotray/

MightyPork commented 11 years ago

You say "what happens when it's clicked on is up to the window manager". That is nonsense.

You found a way how to assign a context menu to right click, so there must be a way how to assign "open window" action to left click. All the other applications can do it - eg. dropbox opens the folder on left click and has a menu on right. Similarly works pidgin, all music players and all kinds of other dockable apps.

Also, there is no reason why it should take five seconds to open a simple text-only menu!

kevincox commented 11 years ago

No, for some reason they are using libappindicator which only allows the application to show a menu and put an icon in the taskbar. These other applications are using things such as GtkStatusIcon that use the free desktop standard for placing menus.

johndrinkwater commented 11 years ago

@MightyPork please be respectful here. The newer indicator protocols have limited features compared to the previous system most other apps still use.

MightyPork commented 11 years ago

I think the best option to fix the closing bug is to edit /usr/bin/steam, and add

export STEAM_FRAME_FORCE_CLOSE=1

right before "function show_message()".

Then it will use this option regardless of the launch method, that is, it will work both with auto-start and with manual start from desktop icon or main menu.

kevincox commented 11 years ago

Yes, this works well. But you have to be careful as /usr/bin/steam will get overwritten during package updates. (not steam's own updates.)

Majkl578 commented 11 years ago

Better is to use e.g. ~/.profile, which will be persistent.

momentary0 commented 11 years ago

This can be simply fixed by this command in a terminal (in Ubuntu at least)

echo 'STEAM_FRAME_FORCE_CLOSE DEFAULT=1' >> ~/.pam_environment

if you want it for all users (not just yourself), you can use:

echo 'STEAM_FRAME_FORCE_CLOSE=1' | sudo tee -a /etc/environment

This is persistent even after updates.

Reference

DarthGandalf commented 11 years ago

@kevincox (or someone from valve) reopen this issue, please.

I don't think such workaround is a proper reason for resolving the github issue, even though the workaround works. Software should behave well by default, without any workarounds. And looking at number of new duplicates of the issue on github, this issue is pretty popular.

So, please reopen it until it's really fixed.

jhasse commented 10 years ago

@DarthGandalf +1

@gdrewb-valve You're right that Steam disappears for people where the app indicator doesn't work. But keep in mind that these people can just restart steam to get the window back. So STEAM_FRAME_FORCE_CLOSE=1 should really be the default.

dtrunk90 commented 10 years ago

I agree. STEAM_FRAME_FORCE_CLOSE=1 should be default. In Cinnamon DE this also appears. Pls refer to the referenced issue by @mtwebster

marceloOrigoni commented 10 years ago

I'm running Arch Linux + Cinnamon as DE, I ran

set STEAM_FRAME_FORCE_CLOSE 1

and added the

STEAM_FRAME_FORCE_CLOSE=1

to the /etc/environment file, but Steam is stil not closing after I cleck the X

kevincox commented 10 years ago

Try closing steam and opening a terminal. Then run STEAM_FRAME_FORCE_CLOSE=1 steam. If minimizing works then the variable is not getting to where you are launching steam from.

kevincox commented 10 years ago

Also set doesn't export the variable unless you add the -a option.

gdrewb-valve commented 10 years ago

Reopening as a feature request to eventually use more sensible behavior when all OS's and window managers work as expected.

marceloOrigoni commented 10 years ago

@kevincox

I tried with -a (also -x and -l) and nothing worked, steam is still minimizing to the taskbar on close. The only thing missing is to resatrt the computer

thestinger commented 10 years ago

Steam now displays a system tray icon when app indicator support is missing, so this workaround does not make much sense to me.

marceloOrigoni commented 10 years ago

The latest version for Arch Linux is from feb 16th, 2014, and it was not showing the tray icon 2 weeks ago. I could make it work after restarting the computer, and I now get the tray icon, and I have not updated the client. It may be working in other distros (probably ubuntu and/or debian)

thestinger commented 10 years ago

I has worked fine for me in Arch Linux with i3 for ages. Perhaps you were in a window manager without a system tray before. I don't think Valve need to worry about supporting environments without a system tray or application indicators - it's a pretty basic requirement.

cjwijtmans commented 10 years ago

This could be as simple as hiding/showing the window when left clicking the tray icon. That is how VLC does it as well.

RamchandraApte commented 10 years ago

I agree with @thestinger and @cjwijtmans. Now the close button should actually close the window (STEAM_FRAME_FORCE_CLOSE=1) by default, specifically)

BTW, KDE's system tray works with Steam.

cjwijtmans commented 10 years ago

note that the tray works perfectly fine with steam in wine. So i dont understand why they are having so much trouble.

AdamSzopa commented 10 years ago

Is this workaround still needed? Perhaps it's time to switch to STEAM_FRAME_FORCE_CLOSE=1 by default?

schoening commented 9 years ago

Linux Mint 17 user here. Still waiting guys..

Celexi commented 9 years ago

The work around doesn't work anymore for me in linux mint 17 since one of the last updates, i have the environment variable set and it does nothing anymore, which is really annoying to have the steam window sit on unused while the program is idle.

kevincox commented 9 years ago

I'm have the same issue on arch.

Celexi commented 9 years ago

Actually never-mind my last post, it does still work but it has to be added to the /usr/bin/steam file, setting it as an user variable seems to do nothing.

schoening commented 9 years ago

The workaround where I edit the steam file works. But I was told that only lasts until steam updates.

tengwar commented 9 years ago

Confirming, exported variable doesn't work on openSUSE 13.2 x64 Gnome with newest Steam.

I added a "STEAM_FRAME_FORCE_CLOSE=1" line to /usr/bin/steam, but it still doesn't work.

HitmanNumber86 commented 9 years ago

"Our hope is that the problems there will get worked out and then we can remove our workarounds and rely on the app indicator, at which point closing the window will close it." --- gdrewb-valve Jan 29, 2013

Almost two years, and this still hasn't been fixed. I just got Steam, for the first time. I thought my install was effed up. I really don't like fighting my computer on things like this.

Celexi commented 9 years ago

Try work around on /usr/bin/steam or as a environment variable, it may or may not work for you ( the usr/bin/steam does for me )

schoening commented 9 years ago

The workaround is still working fine for me btw. Even after steam updates :)