Skip to content

"Minimize at startup" option does not work in Mac OS X #1727

@joanbm

Description

@joanbm

As noted by @weslly in PR #1703, the "Minimize at startup" option does not work on Mac OS X (tested in a High Sierra install). Regardless of this setting, the KeePassX window is always visible when launching the program.

Expected Behavior

If the "Minimize at startup" option is checked, the window should not be visible when launching the program.

Current Behavior

The window is visible when the program is launched.

Possible Solution

The Application::applicationActivated signal is always emited when starting the program on Mac, this forces the window to be visible on the screen through a MainWindow::bringToFront() call.

By checking the blame, it is seen that this was done as a workaround for a Qt issue. If this issue is solved in current Qt versions (I think so), then at the very least, it should be placed under a conditional macro in order not to break new Qt versions. Ideally, we would find a way to avoid or work around the issue that doesn't break the "Minimize at startup" functionality.

It's not wrong to handle the Application::applicationActivated event, but it is emmited on startup also, so we should make sure to handle this case along with minimize on startup.

Steps to Reproduce (for bugs)

  1. Open KeePassXC
  2. Go to Options and check the "Minimize at startup" checkbox. Apply the changes.
  3. Close KeePassXC
  4. Open KeePassXC
  5. Observe the window is still visible at startup

Context

Same as issue #1700: Mainly for unlocking a KeePassXC Database on boot, where it is desirable for the window not to be visible.

Debug Info

KeePassXC - Version 2.3.1-snapshot
Build Type: Snapshot
Revision: 970cedf

Libraries:

  • Qt 5.10.1
  • libgcrypt 1.8.2

Operating system: macOS High Sierra (10.13)
CPU architecture: x86_64
Kernel: darwin 17.0.0

Enabled extensions:

  • Auto-Type

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions