keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

macOS: use 'hide' instead of 'minimize'

Open basbebe opened this issue 3 years ago • 7 comments

Summary

Instead of 'minimizing' the window after autotype, unlock and open, the application should become 'hidden' on macOS instead of 'minimize. Otherwise, there should be an option to do so.

Examples

Use 'hide" in the relevant application options or give users an additional option do 'hide' instead of 'minimize'.

Context

On macOS, 'minimize' closes the application window to the dock, but it doesn't change context That means, althoug the KeePassXC window is gone, the application is still in the foreground / in focus.

Example:

  • KeePassXC is minimized
  • browse with installed browser extension to a login site
  • CTRL-SHIFT-U
  • KeepassXC pops up to become unlocked
  • after unlocking, KeePassXC window is minimized but the application is still in foreground / in focus
  • => the user needs to select the browser window to regain focus.

I think UX-wise it would be more intuitive (at least for me) to have KeePassXC 'hidden' instead of 'minimized'. By this, the window disappears immediately and focus is back to whatever application was opened before.

basbebe avatar Feb 02 '21 08:02 basbebe

I fixed this in my autotype PR #5864 The previous window is explicitly selected for focus after the autotype action is chosen.

droidmonkey avatar Feb 02 '21 11:02 droidmonkey

I fixed this in my autotype PR #5864 The previous window is explicitly selected for focus after the autotype action is chosen.

but is this also true for minimizin on startup and after unlock?

basbebe avatar Feb 02 '21 11:02 basbebe

So you actually mean closing the window so that the "instance" does not appear in macos dock? You can enable the system track icon and minimize to tray, that would do what you want. We already hide the window in the dock when minimized.

droidmonkey avatar Feb 02 '21 11:02 droidmonkey

This makes more sense to me now: https://apple.stackexchange.com/a/9049

droidmonkey avatar Feb 02 '21 12:02 droidmonkey

This makes more sense to me now: https://apple.stackexchange.com/a/9049

Yes – I think that makes it more clear than my ramblings.

basbebe avatar Feb 02 '21 12:02 basbebe

I think exit on close should also be off by default on macOS.

phoerious avatar Feb 02 '21 17:02 phoerious

Not having the dock icon appear and re-appear instead of just hiding the window and disbale the dock icon always. Makes for odd behavior and the user is not able to interact like other macOS apps.

I mentioned on the other issue that was previously closed. About using:

NSApplication.ActivationPolicy.accessory

This is an issue because I can't use AppleScript to toggle the window with a keyboard shortcut and force focus on the search box. Using the prohibited method (NSApplicationActivationPolicyProhibited) means the applications "has no windows".

example:

if application "KeePassXC" is not frontmost then
	tell application "System Events" to set visible of application process "KeePassXC" to true
	tell application "KeePassXC" to activate
	tell application "System Events" to keystroke "f" using {command down}
else if application "KeePassXC" is frontmost then
	tell application "System Events" to set visible of application process "KeePassXC" to false
	
end if

you get this error:

System Events got an error: Can’t set application process "KeePassXC" to true.

Since KeePassXC doesnt have hot key option for toggling the window AppleScript (or some sort of Alfred, Keyboard Masetro hacks) are the only option to create the hotkey toggle effect.

georgesnow avatar Oct 14 '21 16:10 georgesnow