telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.94k stars 5.14k forks source link

Run Telegram Desktop in background without displaying a tray icon #16062

Closed dancojocaru2000 closed 1 year ago

dancojocaru2000 commented 3 years ago

At the moment, on all Linux desktop environments that are phasing out tray icons, Telegram Desktop lacks the ability to run in the background.

Where the tray is not available, Telegram Desktop should still have an option to run in the background instead of entirely shutting down when the window is closed.

Having a tray icon is undesired, and extensions for adding tray icons are slowly growing unsupported / phased out. Therefore, suggesting installing such an extension is not a solution, nor a desirable workaround.

Furthermore, this is not "minimize on close". The app window should be closed (not visible in Alt+Tab, for example), but the application should still be running, and notifications should still be delivered. Essentially, while the window is closed in this mode, Telegram Desktop would act like a daemon. Keeping the window open when pressing the close button is also undesired behaviour.

Finally, this option should be available on other desktop environments or platforms too (for example Windows). Namely, the option to not show a tray icon but still keep the application running.

ilya-fedin commented 1 year ago

I mean, indicator-messages is just a notification list tray icon, it's not a tray replacement

dancojocaru2000 commented 1 year ago

Sorry to disturb and to be a prick. As much as y'all love the tray and discussing about the replacements proposed and such, that's pretty off topic.

@ts14ic, I'm glad you love the tray. However, for me, Telegram is an extra icon cluttering mine without any benefit. On both macOS and Linux, there is a bubble on the icon in the dock/taskbar that shows the unread messages count.

Apart from that feature which has an alternative, the tray icon of Telegram provides nothing of value to me. Keeping the app running to still receive notifications, however, does. Hence why I created this issue.

I'm glad the tray works for you. I'm not asking to remove it for everyone, just for people who want to do so, so any arguments in support of the tray icon are off topic, because it's already here and it's here to stay.

I just wish the tray icon wouldn't clutter space on the top bar on macOS, and Telegram would keep running to give me message notifications on GNOME and other desktops who don't have a tray.

I'm glad you acknowledged that the tray and receiving notifications (or staying open in the background in general) are orthogonal so it makes no sense to require one in order to have the other. Thank you.

ilya-fedin commented 1 year ago

I believe close to taskbar option is pretty enough

dancojocaru2000 commented 1 year ago

It's not. That option minimizes the window instead of closing it, so it still appears in Alt+Tab menus and in "Mission Control" style views that show all open windows. It also doesn't cooperate too well with tiling window solutions which don't allow minimization. It's a workaround, but not a solution.

ilya-fedin commented 1 year ago

I believe it's something your DE/WM has to solve, not tdesktop.

ilya-fedin commented 1 year ago

We're providing a handle informing we're still running. It's then up to your DE/WM how to present it to you.

dancojocaru2000 commented 1 year ago

And I believe requiring an open window or a tray icon to receive notifications is an anti-feature.

It makes no sense that if I don't show the tray icon on macOS, the app won't stay open, when the whole point of the dock on macOS is to show running applications with an OS provided quit menu entry on right click of that dock icon.

Forgot to mention in the last reply, all minimized icons on macOS create an extra dock entry on the right side of the dock.

I just can't help but feel that this "I think you have to have a tray" comes from having a grudge against users of certain OSes and/or DEs.

As for the handle, that should be the process ID. Using that, macOS shows a small circle under the dock icon to show the application is running. An extra window still open is superfluous when I don't want to send messages right now, and a tray icon is just duplicating the dock icon.

ilya-fedin commented 1 year ago

The thing is we're not on macOS, there's no such indicator and no API to know whether the environment has such indicator. We can't just use macOS behavior here, it will be misleading for most Linux environments.

ts14ic commented 1 year ago

. On both macOS and Linux, there is a bubble on the icon in the dock/taskbar that shows the unread messages count.

Well, I found this thread, because specifically I was specifically trying out gnome, and there's no bubble anywhere. Unity is dead. Gnome has no bubble. Every other DE has a tray.

I'm not asking to remove it for everyone, just for people who want to do so, so any arguments in support of the tray icon are off topic, because it's already here and it's here to stay. I just wish the tray icon wouldn't clutter space on the top bar on macOS, and Telegram would keep running to give me message notifications on GNOME and other desktops who don't have a tray.

Well, you mentioned it again, that you don't want the tray, and I mentioned why I want the tray. It's either both are on-topic or off-topic.

dancojocaru2000 commented 1 year ago

The thing is we're not on macOS,

I'm not exactly sure what you mean by that. Telegram Desktop runs on Windows, macOS and Linux.

We can't just use macOS behavior here, it will be misleading for most Linux environments.

It won't? If there is a tray available, Telegram Desktop automatically shows a tray icon if I'm not mistaken. So this would affect only people who actively disable the tray icon, and then actively decide they still want the application running in the background to receive notifications or other such reasons.

On GNOME, which seems the prime motivator for hate against my idea, it is the expected behaviour that an application who still wants to do stuff in the background will just keep running even after the last window is closed if that was turned on in settings (an example would be Geary), so there wouldn't be any misleading there either.

I don't see anybody who would be negatively affected or mislead by this.

ilya-fedin commented 1 year ago

I'm not exactly sure what you mean by that. Telegram Desktop runs on Windows, macOS and Linux.

Yeah, such behavior is used on macOS by checking the platform we're running on.

So this would affect only people who actively disable the tray icon, and then actively decide they still want the application running in the background to receive notifications or other such reasons.

There was a period (somewhere in 1.x versions I think) when the check for tray icon availability was broken. There were a lot of reports from people not understanding how to quit from tdesktop.

On GNOME, which seems the prime motivator for hate against my idea, it is the expected behaviour that an application who still wants to do stuff in the background will just keep running even after the last window is closed if that was turned on in settings (an example would be Geary), so there wouldn't be any misleading there either.

We don't have 'GNOME platform', we have 'Linux platform'. The situation is it's native for most Linux environments to not to run in background without an indicator such as tray icon or taskbar icon. Thus, we follow that.

I don't see anybody who would be negatively affected or mislead by this.

You can search 'quit telegram' in the issue tracker and see these people.

dancojocaru2000 commented 1 year ago

Well, I found this thread, because specifically I was specifically trying out gnome, and there's no bubble anywhere.

Unity is dead. Gnome has no bubble. Every other DE has a tray.

Ubuntu Unity actually just recently became an official Ubuntu flavour, so it's very much not dead. But that's just a nitpick.

As for GNOME, will recheck when I get home, but I'm pretty sure I recall a message bubble.

Well, you mentioned it again, that you don't want the tray, and I mentioned why I want the tray. It's either both are on-topic or off-topic.

If I disable the tray icon, without the feature proposed in this issue, I no longer have notifications, so it is on-topic. Me not wanting the tray icon highlights a use case that supports this feature.

If this feature is accepted and implemented, the current behaviour for people using the tray will not change. As such, liking the tray is neither supporting or unsupporting this feature, hence why off-topic. It provide no pro or con input.

ts14ic commented 1 year ago

Ubuntu Unity actually just recently became an official Ubuntu flavour, so it's very much not dead. But that's just a nitpick.

https://ubuntu.com/desktop/flavours - no Ubuntu Unity here, which is a derivative developed by someone outside Canonical

dancojocaru2000 commented 1 year ago

Yeah, such behavior is used on macOS by checking the platform we're running on.

Will have to recheck when I get home, but IIRC if I disable the tray icon on macOS then Telegram does shut down when the window is closed. I might be wrong on this though.

There was a period (somewhere in 1.x versions I think) when the check for tray icon availability was broken. There were a lot of reports from people not understanding how to quit from tdesktop.

You can search 'quit telegram' in the issue tracker and see these people.

Hold up, you're talking about different things.

That was the implicit behaviour which was unexpected, with no clear indication of that's wrong.

What I'm proposing is an explicit behaviour: the user has to knowingly disable the tray icon, knowing the quit menu from it will go away with it, and enable running in the background. As such, the user in this case is explicitly and consciously opting in to the behaviour, instead of having it by default without understanding what's going on.

We don't have 'GNOME platform', we have 'Linux platform'. The situation is it's native for most Linux environments to not to run in background without an indicator such as tray icon or taskbar icon. Thus, we follow that.

There is no Linux platform when it comes to GUI applications. There's X11 and Wayland, which are the closest to what you might call platforms, and trays are not parts of them. Trays are common but not universal extensions.

As you just said, "most Linux environments". If it were a platform, it would be all. But it's not. It just happens that a bunch of DEs decided to preinstall the tray package. There's no obligation for someone building their own environment with a window manager to install the system tray packages, nor is there any obligation for any DE to do so. This is really just a forced assumption on your part.

This, however, is also offtopic. Even with a tray, as has been said, it's orthogonal to require that icon to keep the app running to get notifications.

dancojocaru2000 commented 1 year ago

Ubuntu Unity actually just recently became an official Ubuntu flavour, so it's very much not dead. But that's just a nitpick.

https://ubuntu.com/desktop/flavours - no Ubuntu Unity here, which is a derivative developed by someone outside Canonical

That's because it's not yet an LTS release.

https://9to5linux.com/canonical-accepts-ubuntu-unity-as-official-ubuntu-flavor-starting-with-ubuntu-22-10/

ilya-fedin commented 1 year ago

What I'm proposing is an explicit behaviour: the user has to knowingly disable the tray icon, knowing the quit menu from it will go away with it, and enable running in the background. As such, the user in this case is explicitly and consciously opting in to the behaviour, instead of having it by default without understanding what's going on.

The necessity of an option is the reason why this is still not implemented. If there were some standardized API so we can do this without adding new option, this were implemented long time ago.

There is no Linux platform when it comes to GUI applications. There's X11 and Wayland, which are the closest to what you might call platforms, and trays are not parts of them. Trays are common but not universal extensions.

Well, we have 'Linux platform' in the code. I talk about tdesktop code.