ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

[Improvement] Hide to tray upon closing

Open AdamB2023 opened this issue 2 years ago • 5 comments

ChatGPT isn't used constantly, but mostly when required, so having it in tray instead of taskbar would be the more comfortable option.

Could you add an option which makes hiding in tray when clicking close button, as an option? There's a option now to hide, but it's in menu, means more user actions is needed.

AdamB2023 avatar Dec 27 '22 20:12 AdamB2023

There is currently no API for hiding taskbar icons on platforms other than mac.

lencx avatar Dec 28 '22 03:12 lencx

The app is moved to tray with hide option, and disappear from taskbar, so the API is available. Just the behavior of using a close button could be different from now, so the user would make fewer clicks to achieve it.

AdamB2023 avatar Dec 28 '22 14:12 AdamB2023

The hidden window is the main process of the chatgpt app, and if it exits, the app will exit.

lencx avatar Dec 28 '22 16:12 lencx

It doesn't need to exit, it's a common standard for many Windows apps to stay only in tray (ex. Telegram, Caprine, Discord, Skype, Slack). They are handling the close button behavior differently than default app exit action.

AdamB2023 avatar Dec 28 '22 18:12 AdamB2023

But none of them are based on tauri implementation. I am not currently able to solve the problem you describe, you can tell me by checking the tauri documentation, I would be happy to implement this feature.

lencx avatar Dec 28 '22 23:12 lencx

This may be helpful. It appears that you can attach hiding main window + tray on exit. https://github.com/tauri-apps/tauri/discussions/2684

AdamB2023 avatar Dec 31 '22 13:12 AdamB2023

That's how it's handled now, and it's not the problem you want to solve. https://github.com/lencx/ChatGPT/blob/main/src-tauri/src/main.rs#L77-L91

lencx avatar Dec 31 '22 13:12 lencx

Also https://tauri.app/v1/guides/features/system-tray/

We have both:

  1. Closing with [x] - it hides main window, but keep on taskbar
  2. ChatpGPT -> Hide (ctrl+H) - it hides main window, and remove from taskbar

What was requested is handling [x] like in 2.

AdamB2023 avatar Dec 31 '22 13:12 AdamB2023

You can hide the window in 2, but you cannot remove it from the taskbar.

lencx avatar Dec 31 '22 13:12 lencx

The (2) option is removing from taskbar. Video: https://dl.dropboxusercontent.com/s/5w4avalm5ehzzck/20221231_1672495193.mp4

AdamB2023 avatar Dec 31 '22 13:12 AdamB2023

Removing it from the taskbar will kill the program.

lencx avatar Dec 31 '22 14:12 lencx

No, the program is still running, and can be opened from tray. Vide: https://dl.dropboxusercontent.com/s/b9rvrpzkya1vewb/20221231_1672495290.mp4

AdamB2023 avatar Dec 31 '22 14:12 AdamB2023

I see what you're saying, it's hidden on windows, but it won't work on mac.

The tray opens the tray window, which is two different windows from the main window. And how do I redisplay the main window?

lencx avatar Dec 31 '22 14:12 lencx

Can't the Hide (ctrl+h) not be the X for closing? Cause this is quite annoying as it is now. The shortcut doesn't work for me, no idea why. But when I hide it, and then click the tray icon, it opens the window again together with the smaller tray window.

bokkoman avatar Mar 01 '23 08:03 bokkoman

Can't the Hide (ctrl+h) not be the X for closing? Cause this is quite annoying as it is now. The shortcut doesn't work for me, no idea why. But when I hide it, and then click the tray icon, it opens the window again together with the smaller tray window.

You can now tap [x] to exit the application (Control Center -> Settings -> Main Window -> Close Exit).

lencx avatar Mar 01 '23 11:03 lencx

This doesn't work. Well it does, but it closes the whole process, so even the tray icon is closed.

bokkoman avatar Mar 02 '23 07:03 bokkoman

+1, close button only hides the main window, but on Windows most of the times expected behavior is to close GUI window, but keep the tray process. Would be really amazing to have a behavior like that.

SnowPowerCore avatar May 06 '23 13:05 SnowPowerCore