elementary / dock

A quick app launcher and window switcher for Pantheon and elementary OS
https://elementary.io
GNU General Public License v3.0
88 stars 23 forks source link

Show apps icons if apps are running in the background but have no open windows #99

Open pongloongyeat opened 3 years ago

pongloongyeat commented 3 years ago

Problem

For certain apps like Discord, closing Discord only hides all its windows but the application is running in the background. On Windows, these kind of apps would show an icon in the systray but eOS doesn't support systrays.

Proposal

It may be good to show the app icon in the dock, with an additional "Quit 'Discord'" when right clicking on the app icon in the dock.

Prior Art

MacOS

https://user-images.githubusercontent.com/31680656/116030665-ac3a4980-a68e-11eb-9b92-4ecd2bf5af0f.mp4

cassidyjames commented 3 years ago

We do currently show app icons if the app is running in the background and has a notification badge or is communicating progress. I'm not sure if an app running in the background while not communicating anything should live on the dock, as that seems like it could get really cluttered, really fast. Then again, it might be more transparent to the user, especially if that app is consuming resources (e.g. affecting battery life).

If we're to make any changes to this behavior, we should probably be using the Backgrounding portal; apps can request to run in the background, and if allowed by the user, we could decide how/where to show that. It might be on the dock, or it might mean showing it in the Power indicator.

cassidyjames commented 3 years ago

For some related prior art, Android has several system APIs that allow power-conscious background tasks, but if an app wants to fully run in the background, the OS requires that app to have a persistent notification. The equivalent APIs for us would be requiring an app to get explicit user permission with the Backgrounding portal, and/or allowing background use when displaying a badge or progress (as that's how we show the app in the dock).

We should also look into the GNOME Shell design as I know they have a way to notify the user of background apps that aren't using the Backgrounding portal, as well as a way to prevent them from running.

pongloongyeat commented 3 years ago

We do currently show app icons if the app is running in the background

Ah that's odd. I filed this as I couldn't see Discord showing up on the dock even after I've closed it. Perhaps it may be a Discord-specific issue but I'll leave this open since there's some input/discussion.

cassidyjames commented 3 years ago

@pongloongyeat I mean you can't just ignore the rest of that sentence:

We do currently show app icons if the app is running in the background and has a notification badge or is communicating progress.

If Discord isn't showing a notification badge on the dock or communicating progress, then it won't currently show up on the dock; the reason being a user may have many apps running in the background that are not intended to be visible at all times, and showing all background apps would get messy. I do think the Power indicator is a better place to expose this information.

pongloongyeat commented 3 years ago

I mean you can't just ignore the rest of that sentence:

Ah my bad, didn't mean to come off that way.

As for my personal opinion, I like the idea of showing it in the power indicator, but only if the process has been idling for quite some time. And if it were to show in the power indicator persistently, it may not work well for people who often switch between applications via the dock, especially if they're constantly switching between an app that does not hide its windows and a Discord-like app (in terms of not showing windows).

I do like the idea of showing it in the notifications indicator if it is running in the background though, much like Android does. This may require some sort of "un-dismissible" property in the notifications server so the notifications indicator knows not to allow the user to clear that notification. This is based on my opinion that if the notification were to be dismissed, the user may forget about it and will only be notified if it's consuming lots of power (like what I've proposed above).