EragonJ / Kaku

🎧 Kaku is a highly integrated music player supports different online platform like YouTube, SoundCloud, Vimeo and more. Available on Mac, Windows and Linux.
https://kaku.rocks
MIT License
1.07k stars 111 forks source link

[Linux] Minimize to tray (instead of closing the app) #528

Open Fincer opened 6 years ago

Fincer commented 6 years ago

Bug

The application has a tray icon. As an user clicks "Close" button on the application main window, the application closes. I would prefer minimizing it to the tray and closing it by selecting such option after right-clicking the tray icon.

May need an additional application menubar with File -> Close option?

Steps to reproduce the bug

Press hard-coded "close" button. Expected the application to be minimized in the tray. Instead, the whole app closes.

What is your Kaku version?

1.9.0

What is your OS (with version number)?

Arch Linux x86_64 (KDE/Plasma 5 desktop)

EragonJ commented 6 years ago

@Fincer @funilrys is that the native behavior in linux ?

Fincer commented 6 years ago

Minimizing to tray by pressing a close button is native or achievable behavior for these apps, at least:

Personally, I'd pretty much prefer the behavior which is implemented in Whatsapp-desktop, for example. Kaku has a tray icon but it's not really that useful because the main app window gets just minimized to the main application panel, too. Minimizing Kaku only to tray area is impossible with the current tray implementation.

Here's a screenshot illustrating the current situation (please pay attention to Whatsapp and Kaku): Screenshot - Kaku & Whatsapp tray

Both Whatsapp and Kaku are minimized the same way but only Kaku is presented in the application panel, too.

EragonJ commented 6 years ago

Because I don't have Linux, what I can do is quickly scan whatsapp desktop's source code, so if I misunderstood things wrong, please tell me.

https://github.com/Enrico204/Whatsapp-Desktop/blob/master/app/main.js#L532-L539

Based on these lines, it looks like how they show/hide window and quit app is based on whether you did enable tray settings or not https://github.com/Enrico204/Whatsapp-Desktop/blob/master/app/js/views/settings.js#L91

If tray settings is not enabled when you close the window, the app will be quitted directly. Instead, if it's enabled, the window will be hidden.

If this is the native way in Linux, we can follow this way if needed. This can be an improvement issue.

Fincer commented 6 years ago

Yes, it is exactly as you described it. "Show Tray Icon" is toggleable option in Whatsapp-Desktop settings and behaves as you said.

I'd absolutely prefer that kind of behavior for Kaku, too. Implementing "Show in tray" toggle button in Kaku Settings and similar code part would be good enough for Linux at least. :+1:

p2635 commented 5 years ago

Same for Windows 10 please.