bunqCommunity / bunqDesktop

The unofficial, free and open source desktop application for the bunq API
https://bunqdesk.top
MIT License
272 stars 52 forks source link

Minimize to tray? #479

Closed LiroyvH closed 3 years ago

LiroyvH commented 5 years ago

Unless I misunderstood what this feature is supposed to do, I had thought it would fully background the application. (So it wouldn't show up in Dock anymore, only the logo in Menu Bar Extras area next to the clock will remain in place). However, minimising the app (yellow button) or "stopping" it (red X) either results in the app minimising to the Dock (logo stays there) or the application quitting. edit: Same results for cmd+w (close window) and cmd+x (quit).

Is this how it's supposed to work? If so, what is the minimise to tray supposed to do? :) I have not set the app to be in the dock permanently. If this is not intended behaviour and a bug, I'm not sure what additional information I can provide. I've started the application from the terminal, and no debug information shows up when minimising it.

Version: 0.9.5, fresh install, OAuth OS: MacOS Mojave 10.14.3.

Crecket commented 5 years ago

The tray is the dock on MacOS I'm guessing but it might work a bit differently than how I've tested it since I'm not a MacOS user.

LiroyvH commented 5 years ago

@Crecket Ah, the dock is the default to minimise to in MacOS. :) Any app you click to minimise will just minimise to its own icon in the dock whilst it's running. That'd mean the function doesn't really do anything on MacOS haha. It'd be cool if minimise to tray would minmise to the Menu Bar (where the bunqDesktop icon also shows next to the clock). Essentially it would make itself disappear from the dock and only run in the background when you hit the X (red) and/or - (yellow). (Yet, for consistency sake, it should probably only do this upon minimise (yellow) or cmd+w (close window) and keep honoring the cmd+q (quit) so users can actually fully quit with that command as you would expect.) When foregrounding it through the Menu Bar icon, it'd relaunch itself to dock. I'm not a developer so don't know exactly which function would have to be called for that, I just know many apps launch themselves in the background as such. (Not sure if they have a special helper application that arranges this for them, I don't think they (all) do, must be a call somewhere.)

The advantage is that you can keep bunqDesktop running without it cluttering up your Dock. The icon in the "tray" (Menu Bar) would be the only thing showing up, and you can control the whole thing from there or get the application to foreground itself through there. This also improves the "launch on Login" behaviour as it would mean you can get bunqDesktop to launch in the background rather than through the Dock. (Although that's potentially problematic as you have to enter your password for it to actually load. Keychain could perhaps be leveraged for that, but this is getting more and more convoluted, so I'll stop suggesting stuff now haha.)

If you don't have MacOS though, I can imagine that may be difficult to test. I'd be happy to test if needs be. Otherwise, it might be an idea to simply remove said feature from the MacOS version as it doesn't seem to do anything other than performing what MacOS already does by default: hide the screen under the Dock icon.

I did find a StackExchange topic that appears to discuss the behaviour in Electron apps running on MacOS, just in case it is helpful: https://stackoverflow.com/questions/37828758/electron-js-how-to-minimize-close-window-to-system-tray-and-restore-window-back

So I guess this isn't really a bug as the current behaviour seems to be expected behaviour, but more of a feature request. Incidentally, for users of Bartender for Mac it might be nice if the Menu Bar item is also animated when there's a new activity (eg: notification). You can make Bartender auto-show the icon for x period of time when there's activity and then hide it again.

Either way, thank you for your prompt response and potential consideration.

Crecket commented 5 years ago

This might be related to the #481 fix where the menu wasn't loaded correctly so please let me know if the behavior improves after the next release. Otherwise I'll mark this as an enhancement and redo the behavior to make it properly behave like other MacOS applications.

LiroyvH commented 5 years ago

@Crecket Nope, it still minimises to the dock rather than the "tray" using the yellow button and the red button to make the screen go away still kills the whole app.