Ximi1970 / systray-x

SysTray-X: A system tray extension for Thunderbird. Needs both the addon AND the companion app installed to work. Will not work with TB flatpaks or snaps.
Mozilla Public License 2.0
218 stars 14 forks source link

Separate close and minimize actions #45

Closed hockeymikey closed 1 year ago

hockeymikey commented 4 years ago

Currently seems that the minimize and close buttons do the same thing. Ideally would be great to be able to configure this so say minimize button does so to the task bar like normal and the close sends it to the status bar and removes from the taskbar. But it seems like from this issue https://github.com/Ximi1970/systray-x/issues/32 that is a known limitation and something that needs to be figured out.

Ximi1970 commented 4 years ago

Another option coming up...But not for the current release I am planning. Still updating my test distributions....

At the moment the buttons can do this:

Minimize: minimize to taskbar or minimize to tray. Close: close, or close child windows and minimize main to tray or taskbar or minimize all to taskbar or tray.

Icemole commented 3 years ago

At the moment the buttons can do this:

Minimize: minimize to taskbar or minimize to tray. Close: close, or close child windows and minimize main to tray or taskbar or minimize all to taskbar or tray.

I don't have the option "when closing: minimize to tray". I only have "Default close", "Minimize main, close children" and "Minimize all windows". Is this intended? I'm really interested in that functionality. I can open a separate issue if you want.

Ximi1970 commented 3 years ago

You can set minimize to tray in the Minimize section

Icemole commented 3 years ago

Yes, but that's not possible when pressing "close", I know it may sound contradictory but I believe many users use that functionality.

However, thanks for reminding me that it's on the "minimize" action, I will get used to it :)

whtyger commented 2 years ago

Can I upvote this suggestion? Currently "Close" block of options depends on "Minimize" selection. It is impossible to set separate behavior for Minimize and Close buttons: on Minimize button TB is minimized to panel, on Close it is minimized to tray. This behavior is similar to some messaging applications, like Telegram. In this way it preserves normal application minimizing and in the same time prevents accidental closing when Close button was pressed.

Icemole commented 2 years ago

As for the project's status right now, if Minimize -> Minimize to tray and Close -> Minimize all windows are set, the behavior "works" as expected. I only use the close button, so it works for me.

whtyger commented 2 years ago

I see. You use different approach. As for me, I use both Minimize and Close buttons and looking for the behavior described by OP. Hopefully the author will implement this feature.

LinAGKar commented 1 year ago

Honestly, OP's described behavior shouldn't even be something you need to configure it to, that should be the default. That's how pretty much all other applications with tray icons work. Changing how the minimize button works should IMO not be the default.

palves commented 1 year ago

Count me in as another one who was going to report this same issue, only to find it has already been filed long ago. I'd love for it to be possible to keep the minimize button minimizing as normal, and have the close button (on the main window) minimize to tray. Really surprised this isn't the default.

Ashark commented 1 year ago

The same here. I also was surprised how strange it is implemented now. I do not need to redefine usual minimize behavior, so when you press minimize, it should be minimized to taskbar. I want to redefine the close button behavior, so when you press close, it should be minimized to tray.

Screenshot ![Screenshot_20230720_101211_](https://github.com/Ximi1970/systray-x/assets/22634975/aa5cfaaf-6c7a-4528-a313-b8a7abecf966)

Currently, as of systray-x-kde 0.9.3-1, close to tray works only when I also redefine behavior for minimize (which I do not want).

Ximi1970 commented 1 year ago

Added in the new release 0.9.4. The actions for minimize, close and icon click are separately programmable. The old default actions remain (all actions to the tray). If you want to change them, do it in the preferences.

Ashark commented 1 year ago

@Ximi1970 Thanks. What is "icon click"? Is it the icon of the window in the left top corner?

Ximi1970 commented 1 year ago

Systemtray icon click

LinAGKar commented 1 year ago

Still plays the minimize animation when clicking the close button, but other than that it's fine now.

Ashark commented 1 year ago

And that minimize animation direction is to taskbar instead of to the tray. Not a big problem though.

Ximi1970 commented 1 year ago

I cannot change the animation in X11, they are part of the window manager. In Windows 10 or 11 it should be possible but I will not go into that rabbit hole...

LinAGKar commented 1 year ago

But why minimize the window before hiding it? For exampe, in WindowCtrlUnix::minimizeWindow, XIconifyWindow is called even if XWithdrawWindow is gonna be called, and similarly in WindowCtrlWin::minimizeWindow, ShowWindow(..., SW_MINIMIZE) is called before calling hideWindow.

Ximi1970 commented 1 year ago

Ah I see. I really need to check if all the window managers will accept the XWithdrawWindow only command nicely. I will have a look to refactor the minimize / hide a bit. Please be patient. I need to update all my VMs ((>30 distros) to test this a bit.