keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.01k stars 1.42k forks source link

Startup minimization combined with showing an icon in the system tray hides outside window #11013

Open laribA opened 1 day ago

laribA commented 1 day ago

Overview

Enabling both "Minimize window at application startup" and "Show a system tray icon" causes the outside bordering window (the Groups view on the side, the Searches and Tags menu, and the entry details on the bottom) to not appear when the database is unlocked.

Steps to Reproduce

  1. Enable "Minimize window at application startup" in KeePassXC settings (or change MinimizeOnStartup=true in ~/.config/keepassxc/keepassxc.ini).
  2. Enable "Show a system tray icon" in KeePassXC settings (or change ShowTrayIcon=true in ~/.config/keepassxc/keepassxc.ini).
  3. (Re)start KeePassXC.

Expected Behavior

The outside bordering window (the Groups view on the side and the entry details on the bottom) is visible.

Actual Behavior

The outside bordering window is not visible. Neither the Groups view, the Searches and Tags menu, nor the entry details are present. The only things shown are the entries in the current group and the menu and tool bars.

Context

KeePassXC 2.7.9 Revision 8f6dd13

Operating System: Fedora Linux 40 Desktop Environment: KDE Plasma 6.1.1 Windowing System: Wayland

Full Debug Info

KeePassXC - Version 2.7.9 Revision: 8f6dd13

Qt 5.15.14 Debugging mode is disabled.

Operating system: Fedora Linux 40 (Forty) CPU architecture: x86_64 Kernel: linux 6.9.6-200.fc40.x86_64

Enabled extensions:

Cryptographic libraries:

droidmonkey commented 1 day ago

These settings don't have anything to do with the group/preview view being collapsed. There is a calculation error somewhere that causes this to happen (once) when moving from 2.7.8 to 2.7.9. Once you resize the group and preview panel it won't happen again. I am still trying to figure out what the circumstances are that cause it, but it is not these settings.

droidmonkey commented 1 day ago

Although you inspired me to think a bit, and perhaps the cause of this issue is indirectly related to these settings. If your config file doesn't record the splitter sizes correctly and you update to 2.7.9 and you use minimize on startup... then it is possible that main window will have a width/height of 0 which will cause the splitters to hide the group and preview panels.

I attempted to remedy this by also setting the splitter sizes after the database is unlocked, which would normally happen when the main window is shown again and having a proper width/height.

https://github.com/keepassxreboot/keepassxc/pull/11014

laribA commented 1 day ago

These settings don't have anything to do with the group/preview view being collapsed. There is a calculation error somewhere that causes this to happen (once) when moving from 2.7.8 to 2.7.9. Once you resize the group and preview panel it won't happen again. I am still trying to figure out what the circumstances are that cause it, but it is not these settings.

It would make sense that those settings don't affect the group, but if it's useful in debugging the error, I tried wiping my config file, and found out that the issue ONLY happens when those two specific settings are enabled, and persists, even after restarts and reboots. If either of those two settings are disabled, both panels show up like normal. Even in a config file with nothing but MinimizeOnStartup=true and ShowTrayIcon=true under [GUI], the issue occurs if you haven't resized the panels. Your fix of resizing the panels worked, thanks.

P.S. Wild how we commented at the same time.

droidmonkey commented 1 day ago

Thank you for the additional context, I will try to see if my fix prevents the issue with the config file wiped but those settings applied

droidmonkey commented 1 day ago

Confirmed, that is exactly what happens and what causes the bug. I also noted that if you never resize the KeePassXC window then your splitter locations will never be saved to the config file. That could explain why a handful of people experienced this problem. I will think of a fix for that problem as well.