Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize to tray #2799

Closed
lalomartins opened this issue Dec 23, 2016 · 9 comments
Closed

Minimize to tray #2799

lalomartins opened this issue Dec 23, 2016 · 9 comments

Comments

@lalomartins
Copy link

lalomartins commented Dec 23, 2016

… would be nice, since by nature this is an app that stays most of the time on the background. Major competitors alternatives do.

edit: original title was “on Windows” but of course it's a good idea for Linux as well.

@carlos22
Copy link

This would be also useful for linux.
Example Electorn app which has tray suport: https://github.com/saenzramiro/rambox/blob/915a56088567406d79cac389ee37bf683b8e24c5/electron/tray.js

@eNTi
Copy link

eNTi commented Jan 15, 2017

yes please. linux user here.

@lalomartins lalomartins changed the title Minimize to tray on Windows Minimize to tray Jan 15, 2017
@lalomartins
Copy link
Author

Rambox is MIT, so we could just copy-paste the code wholesale (with appropriate changes). The real work would be:

  1. Adding a checkbox to the config, if wanted.
  2. Importing this new module somewhere appropriate.
  3. The standard behaviour is, if “minimize to tray” is enabled, closing the window doesn't quit the app, just hides it. So one would have to implement either this, or removing the app from the taskbar when it's minimized.

I'm happy to make a PR if maintainers think it's a good idea. Other than the checkbox, this is 100% Electron stuff, so there's no question of Riot vs. SDK. I could just opt out of the checkbox… a quick look at the code suggests that could be a little more than I would be willing to bite on as a first-timer.

@carlos22
Copy link

carlos22 commented Jan 15, 2017

We also need to consider the Multiple-Instances Issue. Most of the time you only want a Single Instance. Especially on modern systems like gnome3 (they do not have any solution for background-apps besides their internals).

Electron has support for Single Instances: https://github.com/electron/electron/blob/master/docs/api/app.md#appmakesingleinstancecallback

Possible Settings UI:

  • Enable Tray-Icon
    • Close to tray
    • Single Instance

Other things to consider:

  • Minimize to tray (personally i don't like it, but some people do).
  • Unread Messages (Indication of them - maybe just icon change like rambox)

@lalomartins
Copy link
Author

@carlos22 I agree on all all of that but multiple instances isn't really related.

Note that minimize to tray is the issue's actual title 😺 a tray icon that isn't used for close/minimize to tray, and displaying notifications on the tray icon, are related but out of scope IMO. And to be honest, if tray is supported, I don't see any reason to make it optional; let's not overcomplicate the settings UI.

The most common behaviour off the top of my head is that closing closes to tray, minimizing goes to taskbar (on both OSes). Of course with that bit being optional.

image

Screenshot from a similar app that will remain unnamed — that's the entire settings page for the “desktop app” tab.

@carlos22
Copy link

@lalomartins Agreed.

Multiple Instances will be still a problem - because in most modern DEs you will run the app again if you are not using the notification area icon (which is often hidden by the OS [e.g. in Win7/10 and Gnome3))

But most important is close to tray. Lets focus on that :-)

@carlos22
Copy link

Things missing for a perfect experience (for me of course ;-)):

  • Single Instance (i.e. starting again just shows the app)
  • Launch app on login (hidden/tray-minimized)

The later one can be done with a command-line switch to not show the window (needs to be implemented) and using the systems 'Autorun' feature to start the app on login. Better for the users would be a option inside of the app. But there seems to be a solution for that: https://www.npmjs.com/package/auto-launch

Sorry for being slightly off-topic again, but I wanted to note my thoughts without creating new issues. Both features are useless until tray support is merged. I might start experimenting with the single-instance stuff in electron soon.

@lalomartins
Copy link
Author

lalomartins commented Jan 22, 2017

Well, somehow I missed the fact that you had a merged PR and spent a couple of hours doing the same. Ah well, I learned a bit about Electron I guess 😆 meanwhile, thanks!

If you want to copy “red dot” (pending notifications) support from my version, it's at https://github.com/lalomartins/riot-web/tree/tray

@dbkr
Copy link
Member

dbkr commented Feb 7, 2017

PR merged

@dbkr dbkr closed this as completed Feb 7, 2017
@ghost ghost mentioned this issue Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants