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 3 years ago

At the moment, on all Linux desktop environments that are phasing out tray icons

That's completely false. Only GNOME and Pantheon lack tray icons, all other desktop environments have tray icons.

As for the feature request itself I vote for wontfix: if GNOME developers think other apps will adapt to their design choices, they're completely wrong and only their apps will work without tray icons correctly.

dancojocaru2000 commented 3 years ago

That's completely false. Only GNOME and Pantheon lack tray icons, all other desktop environments have tray icons.

Please read what I said again. I didn't say that all DEs do that, I said that on DEs that do that, Telegram Desktop lacks a feature.

if GNOME developers think other apps will adapt to their design choices, they're completely wrong and only their apps will work without tray icons correctly.

As I said, this is not only about GNOME. Personally, when using KDE I also like to only have useful things in my tray like choosing the WiFi network, and not "hey, app is running". This setting should apply to all DEs and OSes.

In particular, this would also apply to macOS. On macOS, applications should not use the tray (menu bar extra / status icon) to convey "this app is open" information, the dock does that.

Furthermore, from macOS HIG:

Let people decide whether to enable your menu bar extra. Users, not apps, should choose when a menu bar extra is added to the menu bar. Typically, this is done by changing a setting in an app’s preferences window. To ensure discoverability, however, consider giving people the option of enabling the menu bar extra during setup.

Don’t rely on the presence of menu bar extras. The system hides and shows menu bar extras regularly, and you can’t be sure which other menu bar extras users have chosen to display, or where your menu bar extra will be placed in the menu bar.

Finally, setting the "GNOME [and perhaps Apple] decisions bad" aside, the application running in the background is totally unrelated functionally to having a tray icon. Therefore, pointlessly binding the two together is 100% a Telegram Desktop problem, not a GNOME problem.

lcsvcn commented 3 years ago

I am experiencing the same issue here. I am using Fedora 34 and Telegram Desktop app won't show any notification unless it is open. They have only two states: open or close. No option keep running minimized.

I have tested in other Desktop environments (Windows and Mac) and they work fine, they have a minimize option.

And this is indeed an UX issue, because user should be able to receive notification even if the app is not running in foreground. You may be able to close it and not receive any notification or just run in background mode.

And I don't agree with wontfix logic. Every OS have their own design system and the decision of not supporting one just because you don't use it or don't like it seems selfish.

For example: I don't agree with plenty of Apple decisions, but as a software developer I must comply and follow their design system or don't even bother to release to their platform. If some developer team takes time to discuss, create and document a design system is to help software developers to build applications that fell more integrated to their system.

lcsvcn commented 3 years ago

As I have check now, Discord have implemented a way to keep running minimized in this scenario.

So that is not something impossible, just that isn't implemented yet.

Slack and Telegram does not support this yet.

ilya-fedin commented 3 years ago

@lcsvcn Please install tray extension. Tray-less environments are considered broken (even if it is a design choice).

ilya-fedin commented 3 years ago

@Aokromes can you close this with wontfix?

lcsvcn commented 3 years ago

It is installed. This does not fix anything. That is not a tray issue, it is Telegram issue. Telegram does not work in background mode.

ilya-fedin commented 3 years ago

If you have tray icon enabled, Telegram should run in background. If you don't have, enable it.

lcsvcn commented 3 years ago

It is enable, but telegram does not work.

lcsvcn commented 3 years ago

Discord does...

lcsvcn commented 3 years ago

Screenshot from 2021-04-07 11-56-28

ilya-fedin commented 3 years ago

It is enable, but telegram does not work.

If you're on Wayland, make sure you have Wayland-compatible tray extension (Discord is probably running via XWayland, while Telegram is not). TopIcons, for instance, is not compatible with Wayland, while gnome-shell-extension-appindicator is.

lcsvcn commented 3 years ago

I am using this one: https://extensions.gnome.org/extension/2890/tray-icons-reloaded/

ilya-fedin commented 3 years ago

@lcsvcn its README изображение

lcsvcn commented 3 years ago

So Telegram won't support Wayland?

ilya-fedin commented 3 years ago

Telegram supports Wayland, your tray extension is not. Replace it.

lcsvcn commented 3 years ago

"XWayland is an X Server that runs under Wayland. It provides backwards compatibility for legacy X11 applications." - It supports XWayland, should not support Wayland too since it runs under?

ilya-fedin commented 3 years ago

But looks like you run Telegram with native Wayland, without XWayland.

ilya-fedin commented 3 years ago

should not support Wayland too since it runs under?

XWayland tray extension can handle only XWayland applications. For native Wayland applications you should have extension with native Wayland support.

dancojocaru2000 commented 3 years ago

@lcsvcn

https://extensions.gnome.org/extension/615/appindicator-support/

@ilya-fedin

Tray-less environments are considered broken (even if it is a design choice).

This issue is not about tray-less environments.

ilya-fedin commented 3 years ago

This issue is not about tray-less environments.

Yeah, there's no real sense to support running in background without tray since tray-less environments are considered broken.

dancojocaru2000 commented 3 years ago

Yeah, there's no real sense to support running in background without tray since tray-less environments are considered broken.

To requote the macOS HIG:

Let people decide whether to enable your menu bar extra. Users, not apps, should choose when a menu bar extra is added to the menu bar.

Even if macOS supports the tray, users should still be able to restrict Telegram from using it.

Likewise for other operating systems and environments.

ilya-fedin commented 3 years ago

Telegram is not forced to follow macOS HIG, fortunately

dancojocaru2000 commented 3 years ago

Well no, Telegram is not forced to improve its software. It's just that that's usually the goal of modifying currently existing software: to make it better to use.

john-preston commented 3 years ago

If there is no tray icon, how does the app detect if it needs to minimize or quit? How does the user quit the app?

dancojocaru2000 commented 3 years ago

The app minimizes when the minimize button is pressed. The window still remains open but in the minimized state. The app closes its window without shutting down when the window is closed.

The user shouldn't be concerned with quitting (and almost never is). Apps such as Geary provide no option of quitting when running in the background is turned on and, frankly, there is no need for it. UWP apps on Windows 10 can also run in the background without providing any indication or any way to quit them. Apple's Messages app on macOS delivers notifications even when the window is closed, without displaying a tray icon.

Of course, some people prefer having an indication of the app running and having an explicit quit option (even though services/daemons provide no such indication or option). For those people, the way Telegram Desktop works now is good.

But for the people who prefer the way Geary works - displaying no tray icon and running in the background without necessarily having an explicit quit option - Telegram Desktop should provide the option to keep running in the background without displaying a tray icon.

etircopyh commented 3 years ago

Apps such as Geary provide no option of quitting when running in the background is turned on and, frankly, there is no need for it. UWP apps on Windows 10 can also run in the background without providing any indication or any way to quit them. Apple's Messages app on macOS delivers notifications even when the window is closed, without displaying a tray icon.

You are too good at providing bad examples.

dancojocaru2000 commented 3 years ago

You are too good at providing bad examples.

Perhaps I am. Why are they bad examples though?

etircopyh commented 3 years ago

Perhaps I am. Why are they bad examples though?

First of all subject itself is absurd as it implies implicit behavior. So it is a bad software design in any case. When you pull the door you expect it to be closed, not remain open. And even if it was implemented as option what for? For poor GNOME decisions? I don't remember apps that would have had such "feature", especially messengers. So Geary and bad software design of Windows UWP and macOS apps is rather an exception than rule.

And the second is that both Windows and macOS never were the ones for good UX. Their only priority is data mining and to sell the product. UWP was a failure concept, for desktop for sure. And macOS has a software design mischief all over the place, the only thing that consistent is UI.

There's basically no point pushing for the edge cases like this, as they are sticking out of software design logic (any logic, really), potentially harmful (user accidentally turning such functionality on and then complaining that TDesktop is a virus)... Well, and there's a ton of reasons why issues like this should be turned to GNOME attention, they are the ones who break things (ask mpv).

dancojocaru2000 commented 3 years ago

First of all subject itself is absurd as it implies implicit behavior. So it is a bad software design in any case.

It does not imply implicit behavior because the behavior is manually turned on. Once I turn it on, I explicitly expect Telegram not to shut down when I close it. Unless you argue that when closing a music player window the music should also stop playing because the player running in the background and continuing to play is implicit behavior.

Telegram doesn't ask the user if they want to receive notifications. Once the app is open, it just sends them. Is that not implicit behavior?

And even if it was implemented as option what for?

For user choice. For hiding a useless tray icon on KDE or on macOS or on Windows (which luckily has built in support for turning off tray icons).

I don't remember apps that would have had such "feature", especially messengers.

I also don't remember apps that tied together two unrelated functionalities, manually created a problem, then pointed the finger at someone else and said "it's their fault".

Discord on Linux runs in the background just fine even if there are no tray icons. Only Telegram manually creates the problem by not running in the background if the tray is disabled, but then blames others.

potentially harmful (user accidentally turning such functionality on and then complaining that TDesktop is a virus)...

I don't hear people swiping away or force closing the Telegram app then complain that Telegram is a virus on their phones because they keep receiving notifications.

Well, and there's a ton of reasons why issues like this should be turned to GNOME attention, they are the ones who break things

If you want GNOME to listen when people complain, perhaps lead by example and not "pull a GNOME" and "no, others should do it like we say"? Doesn't that sound like a better idea since this seems to be specifically a grudge against GNOME?

I don't see why you are entitled to complain about GNOME breaking stuff when Telegram is doing just that, and not listening to feedback when users complain.

ilya-fedin commented 3 years ago

Unless you argue that when closing a music player window the music should also stop playing because the player running in the background and continuing to play is implicit behavior.

If the player doesn't have tray icon, I except it to fully close on window close.

Discord on Linux runs in the background just fine even if there are no tray icons.

Electron doesn't have API to check whether tray icon is supported, so Discord just thinks that the icon is here.

dancojocaru2000 commented 3 years ago

If the player doesn't have tray icon, I except it to fully close on window close.

That's you.

If the player doesn't have a tray icon, I expect the player to continue playing until I reopen the app and pause the music, or use the OS controls to pause the music.

In the same way that I expect a chat app that delivers notifications to also deliver them when the window is closed too. Because it's 2021, not 1995. Apps tend to do that nowadays.

Electron doesn't have API to check whether tray icon is supported, so Discord just thinks that the icon is here.

Great. Let's add an option to make Telegram "just think that the icon is there" too and the problem is half solved (then it comes to looking into OS specific ways to hide the icon).

ilya-fedin commented 3 years ago

Let's add an option to make Telegram "just think that the icon is there"

There was time when the check was incorrect, there were a lot complains that it is impossible to quit from Telegram

ilya-fedin commented 3 years ago

I expect the player to continue playing until I reopen the app and pause the music, or use the OS controls to pause the music.

That's you:tm: ¯_(ツ)_/¯

dancojocaru2000 commented 3 years ago

There was time when the check was incorrect, there were a lot complains that it is impossible to quit from Telegram

And now there are a lot of complaints that it is impossible not to quit while closing the window.

So add an option in settings to make that check incorrect again if the user so desires.

ilya-fedin commented 3 years ago

And now there are a lot of complaints that it is impossible not to quit while closing the window.

I can remember only you and one another guy

etircopyh commented 3 years ago

Telegram doesn't ask the user if they want to receive notifications. Once the app is open, it just sends them. Is that not implicit behavior?

Again, bad example, this is expected behavior and people know what to expect of messenger by default. Later they can adjust it as they wish.

Unless you argue that when closing a music player window the music should also stop playing because the player running in the background and continuing to play is implicit behavior.

Don't know what players you talking about, my players close when I tell them to.

For hiding a useless tray icon on KDE or on macOS or on Windows (which luckily has built in support for turning off tray icons).

And how did applications behave when you do that?

I also don't remember apps that tied together two unrelated functionalities, manually created a problem, then pointed the finger at someone else and said "it's their fault".

Are we talking about GNOME?

Discord on Linux runs in the background just fine even if there are no tray icons.

Yeah? Will check it later.

I don't hear people swiping away or force closing the Telegram app then complain that Telegram is a virus on their phones because they keep receiving notifications.

Yet again, it's expected behavior of smartphones. Nowadays mere user won't even be able to find where to see currently running apps (not that it's a good thing).

I don't see why you are entitled to complain about GNOME breaking stuff

I don't see why are you talking about GNOME as if it's something more than a piece of software just like Telegram is.

not listening to feedback when users complain.

I don't see here a lot of people complaining (in this issue anyway) except for you. Other guy at least tried to find a solution instead of pointing fingers.

etircopyh commented 3 years ago

if the user so desires.

Talking about "entitled"...

etircopyh commented 3 years ago

Judging from amount of all kind of reported issues from GNOME users makes you wonder where's the rub...

olekthunder commented 3 years ago

@dancojocaru2000, first of all, it is good of you to create this feature request. However, it would be better to wait and have some response from another users.

For example, I don't use tray on Linux and I like tgdesktop's behavior not to run in background after the window is closed, so I don't have to look for dedicated setting to turn off this behavior if it is enabled by default. Even if developers would decide to implement this feature without changing default behavior, this feature may not be used much.

ilya-fedin commented 3 years ago

So add an option in settings to make that check incorrect again if the user so desires.

https://xkcd.com/1172/

dancojocaru2000 commented 3 years ago

That's you ¯(ツ)

Yes. That's why settings exist. In the same way that some people prefer the software to be in English and others prefer it to be in French.

I can remember only you and one another guy

There's more.

Back to my point, that's why settings exist. There is no one size fits all software. To be frank, I'm not sure why there is so much drama around adding an option for people who want this feature. It's as if I'm asking Telegram to totally rewrite the codebase or something.

Again, bad example, this is expected behavior and people know what to expect of messenger by default. Later they can adjust it as they wish.

Is it? iOS for example explicitly asks users if applications can deliver notifications to them.

And how did applications behave when you do that?

Do what?

Are we talking about GNOME?

No, we are talking about Telegram. As I said, this seems to be a grudge against GNOME.

Yet again, it's expected behavior of smartphones. Nowadays mere user won't even be able to find where to see currently running apps (not that it's a good thing).

Because there's no need. Especially since smartphones are designed for everybody, the idea is that RAM uses the same power and such if it's full as when it's empty, so apps that don't hurt battery power might as well do stuff in the background when they have to. Bit of a different philosophy from the desktop, but that doesn't mean it's bad or that they should be entirely separate.

Talking about "entitled"...

Again, just like people "entitled" to have translations? Settings and options exist for a reason. However, there seems to be particular opposition against this specific setting because people around here seem to have a grudge against GNOME, even though I specifically mentioned multiple times that I want no Telegram tray icon when using KDE too.

However, it would be better to wait and have some response from another users.

I can wait, I'm just replying to people as they reply to me.

For example, I don't use tray on Linux and I like tgdesktop's behavior not to run in background after the window is closed, so I don't have to look for dedicated setting to turn off this behavior if it is enabled by default.

Sure thing. I never asked for the default behavior to change.

Even if developers would decide to implement this feature without changing default behavior, this feature may not be used much.

I wonder how often people use "Place Telegram in "Send to" menu" or changing the size limit for automatic download. Yet those configurations are still there.

https://xkcd.com/1172/

I know it, nice xkcd. And indeed, bug fixes can lead to people relying on the bug to be annoyed. In this case though, it's quite a legitimate use case that brings zero downsides to anybody who doesn't want it.

olekthunder commented 3 years ago

@dancojocaru2000

But you are already speaking from all of users. Or almost all of them.

The user shouldn't be concerned with quitting (and almost never is).

ilya-fedin commented 3 years ago

be frank, I'm not sure why there is so much drama around adding an option for people who want this feature.

tdesktop follows 'less options is better' paradigm, @john-preston usually doesn't add options unless there's enough affected users. Usually it takes multiple years of regular complaining of a lot of people in order to option being added. And even then there's no guarantee.

etircopyh commented 3 years ago

It's as if I'm asking Telegram to totally rewrite the codebase or something.

You literally proposed to add a bug to fulfill your demand:

So add an option in settings to make that check incorrect again if the user so desires.

dancojocaru2000 commented 3 years ago

You literally proposed to add a bug to fulfill your demand:

That was a hyperbole with the intent of conveying "add an option to restore the old behavior as an user intended behavior".

dancojocaru2000 commented 3 years ago

tdesktop follows 'less options is better' paradigm, @john-preston usually doesn't add options unless there's enough affected users.

If that's the resolution and the motivation, so be it. While I may personally be a fan of Firefox's about:config, I get that not everybody is. It's just that throughout this entire issue, most of the counter replies were "GNOME bad", and some others were "I think this is stupid therefore everybody does", with few actually addressing my point about this being an option.

etircopyh commented 3 years ago

Yes. That's why settings exist.

Imagine what would've become of software if devs granted every user request.

most of the counter replies were "GNOME bad"

Whether it's GNOME or KDE, or any other DE I still think that it's counterproductive to break that desktop app logic. It was always intended that app can run in background if tray icon present, if not then use minimize button... until someone decides otherwise. And comparison to mobile devices is irrelevant, they manage RAM differently, for their own goals and purposes. Let alone smartphones are built for a whole different usage scenarios.

soloturn commented 3 years ago

@ilya-fedin this is not a gnome thing, this is a macosx, ios, android thing - none have tray icons. they know "hide" for an app. macosx still has the legacy minimize though, but see here: https://www.youtube.com/watch?v=FjCiKCy4UHA .

ilya-fedin commented 3 years ago

@soloturn it is known that gnomers are latent macosers so I don't know what you wanted to say