-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
macOS - option to hide dock icon #1334
Comments
I'm not sure about |
One example of a widely-used app that does this is Google Drive. |
Quite a lot of apps do this - yet another example would be DrobBox. |
This ticket is especially important for keeping browser integration without adding noise to alt-tab. |
Another Example is Onedrive. This is important for someone who want to keep their dock clean, like me. |
First off, the examples given are NOT applications, they are services. The little popup you see when you click the icon is just a modal window, not an app window. That is why its not visible in the task bar. Second, you can minimize KeePassXC to tray and keep it there while still using AutoType and Browser integration. I do not think it is even possible to hide from the taskbar from our application. That is typically an OS or window manager concern. Im not a Mac user so I dont know what the limitations are with their icons. |
First of - if you use KeePassXC mostly (only) as a service to keep passwords for browsers then... it's a service (I kinda stopped using KeePassXC because was annoyed by the dock icon and quite frequent, unintentional switching to it when changing apps) Secondly - you may be able to minimize to try under different OSs, but as you stated - you are not a macOS user and the whole point of this ticket is that - it's not possible to minimise app to try currently (there is a workaround with PlistInfo modification, but it's very brittle and doesn't work well). I tried tinkering with it myself, but unfortunately it went over my head. |
Would this work for you: http://ghosttile.kernelpanic.im This code snippet might help implement the desired behavior. When the app is supposed to be minimized to tray (like in windows), we should hide the dock icon. https://gist.github.com/TomLiu/7837127 Technically Qt should be doing this for us. You can also try setting the environment variable And yes, there is a huge difference between background (ie service) applications and foreground applications. The definition doesn't change depending on how you use it, this is an OS distinction. |
We should implement normal macOS behaviour which is to only close the window, but keep the app running when the window close button is pressed. We kind of have that already, but it requires explicit configuration. |
@droidmonkey - I'll try those patches @phoerious - currently close window button closes the window (and it works correctly) - macOS has little bit different notion of application/windows: you can have running application without any window (not minimised - window widget/document completely destroyed), AFAIR it contradicts windows/linux where if you run the app you have the document and (in majority of the times) if you close last document you close the application altogether. |
You can enable the tray icon and then the option to hide the window instead of closing everything. |
Are there any updates on this? |
Not this in particular, but we did fix interaction with the app during browser extension use. The window will properly re-hide itself and stay out of alt+tab. |
@praveendhawan I played a bit with it without much luck (lack of c/qt experience I guess). @droidmonkey I appreciate all the work to improve compatibility with macos, unfortunately this is unrelated to this particular issue :-) |
I'm interested in the inverse of this behavior... I'd like to see the system tray icon gone but the dock icon remain. Do you think others might be interested in this as a separate feature request? |
You can just disable the tray icon in settings. |
@droidmonkey Unfortunately, disabling that option also disables the 3 sub-options that are dependant on it. I like how you can close the KeePassXC window to hide it and the app keeps running and can be made visible again by clicking the dock icon. I just wish that feature did not require adding another icon to my already-cluttered system tray. I know other apps like iTunes and Photoshop have this behavior without adding an icon to the system tray. |
I'll play around with this on our test Mac to see if there is an easy solution. Those three sub options are mainly for windows and Linux envs. |
@droidmonkey Sweet! If I knew more about C++ and Mac development I might even try messing with it myself but its way over my head. I'm just getting started with self-teaching programming and learning iOS development. This app is amazing btw. I've missed Keepass ever since I switched over from Windows. Never could find a good Mac version. This cross-platform approach is terrific! |
I was reading the comments above and usually in macOS to hide a running App from the Dock you need to add the following to
Can't it be done programmatically in Qt? I tried this in my installed App and it works. |
@TCB13 - I played with it a bit and while it hides icon from the dock it messes up the interaction with KeePass - in the end I had to force-close it because I wasn't able to restore the window. Maybe recent changes to improve compatibility would help with the situation. However, adding it to |
@woj-tek you just need to add it to the menu on top (next to the clock), and you can always get it back. |
Have you tried it? Because as I said - I was playing with it a bit and while at the beginning it was working ok I had to revert it because it broke later on... |
@woj-tek I've been using it for a week or so, no trouble at all. :) |
@woj-tek have a look at my current settings: |
@woj-tek ,
I wasn't asking for it to be permanent. We could have a default like:
Then, if user turns on "hide window to system tray when minimized" it could change it to:
This way it would be optional and consistent with the current Windows experience. |
OK, I know what was my issue - I also store some passwords for other applications that don't provide interaction with KeePassXC and with |
@woj-tek interesting, I don't have that use case indeed. Anyway, what do you think about toggling |
I'm not sure that this option should be toggled altogether. IMHO there should be a better way to handle it via Qt. |
In that case that may be a viable option - hopefully developers would consider it :-) |
LSUIElement also remove it from command+tab selection. A perfect behavior should be like onedrive. You can open Onedrive settings and still see it in command+tab, while it is indeed minimized to system tray. |
@xvrxq52Dm6Pu and... that kind of “perfect behaviors” is exactly why Microsoft’s apps for Mac are all full of UI glitches, crashes and others problems - instead of going with native solutions for common problems (that work reliable and in an expected way) they hack stuff around. |
I tried the workaround - and it worked: there is no dock-symbol but only a tray icon. But, now I cannot use auto-type any longer, only if I delete the two lines of code from the Info.plist. |
I have the same usability issue - is there a way to hide the dock icon and have the auto-type working? |
@konrad-a I got used to the symbol in the dock...hope I can get rid of it in the future. |
What I've tried is toggling the
Works for me for the time being. |
I can confirm that this works for me too. Maybe making it the default should be considered. I see no point in having a dock icon when accessing passwords through a browser extension. Especially when the menu bar icon is enabled, the dock icon just provides pointless redundancy. Maybe only hide it when the menu bar icon is enabled? |
I reinstalled by MacOs and ended up googling this issue again. |
@phoerious is this something we can add to 2.6? |
I thought that's already possible when the tray is enabled? |
I stand corrected. The dock icon is still showing, even when pressing the close button. Lemme see if I can fix that. |
Transforms application into a UIElement agent app when minimize to tray is enabled and the window is hidden. This hides the dock icon and removes the application from the Cmd+Tab listing. The changes work well together with macOS's inbuilt hide feature. Also fixes the buggy tray icon context menu trigger behaviour. macOS triggers the tray context menu also on normal left click, which causes the window to toggle at the same time as the menu. To fix this, window toggling has been disabled altogether on macOS and users will be shown only the context menu from now on. Fixes #1334
Changing the plist file is not something you want or can do at runtime, especially not with a signed app. There are other system APIs to achieve the same effect. I proposed a fix, which should resolve this issue and overall improve the tray icon experience. |
Transforms application into a UIElement agent app when minimize to tray is enabled and the window is hidden. This hides the dock icon and removes the application from the Cmd+Tab listing. The changes work well together with macOS's inbuilt hide feature. Also fixes the buggy tray icon context menu trigger behaviour. macOS triggers the tray context menu also on normal left click, which causes the window to toggle at the same time as the menu. To fix this, window toggling has been disabled altogether on macOS and users will be shown only the context menu from now on. Fixes #1334
Transforms application into a UIElement agent app when minimize to tray is enabled and the window is hidden. This hides the dock icon and removes the application from the Cmd+Tab listing. The changes work well together with macOS's inbuilt hide feature. Also fixes the buggy tray icon context menu trigger behaviour. macOS triggers the tray context menu also on normal left click, which causes the window to toggle at the same time as the menu. To fix this, window toggling has been disabled altogether on macOS and users will be shown only the context menu from now on. Fixes #1334
Currently it's possible to show tray icon (the one next to clock) but dock icon still remains. It would be great to be able to hide dock icon and let KeePassXC run "in the background" (only with tray icon)
Expected Behavior
Select "Show system tray icon", add another option "Hide dock icon" to the group of this options
Current Behavior
We have two icons now if we enabled mentioned option. The dock icon could be shown when the window is visible though.
Context
This could limit the clutter in the dock. Long running application are better situated in the tray instead of dock/taskbar.
Debug Info
KeePassXC - Version 2.2.4
Revision: 4723f66
Libraries:
Operating system: macOS High Sierra (10.13)
CPU architecture: x86_64
Kernel: darwin 17.3.0
Enabled extensions:
The text was updated successfully, but these errors were encountered: