Skip to content
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

Hide to tray on minimize and activate window on launch both fail on Wayland #11515

Open
loxoron218 opened this issue Nov 30, 2024 · 5 comments
Open

Comments

@loxoron218
Copy link

loxoron218 commented Nov 30, 2024

Overview

I'm experiencing a bug after enabling the "Automatic closing after opening of the database" feature in KeePassXC. The app behaves as expected in terms of closing and minimizing to the system tray. However, when I try to reopen the app within a few seconds after it has closed, I get the waiting cursor, and the app doesn't open. After waiting for a longer period (10 seconds), I can open the app again.

I normally open KeePassXC right after unlocking the database and closing it to the tray to find links to some websites and open by double-clicking them in the database. This issue prevents me from doing so immediately after closing the app to the tray.

Interestingly, I can always open KeePassXC instantly by hovering over the tray icon and selecting "Show Window."

Steps to Reproduce

  1. Add KeePassXC to the startup applications using GNOME Tweaks.
  2. Enable "Automatic closing after opening the database" in the settings.
  3. Open the database, unlock it, and then let KeePassXC close and minimize to the tray (gnome-shell-extension-appindicator).
  4. Press the "Windows" key on the keyboard to open the GNOME menu
  5. Search for KeePassXC and open it with enter.
  6. Notice the waiting cursor and the app not opening.
  7. After waiting for about 10 seconds you can open the app again manually and it works.
  8. Alternatively, open the app instantly by right-clicking the tray icon and selecting "Show Window."

Expected Behavior

KeePassXC should open immediately when clicked from the app menu without having to wait for about 10 seconds.

Context

KeePassXC - Version 2.7.9
Revision: 8f6dd13

Qt 5.15.16
Diagnosemodus ist deaktiviert.

Betriebssystem: Arch Linux
CPU-Architektur: x86_64
Kernel: linux 6.12.1-arch1-1
Desktop Env: Gnome 47.1
Windowing System: Wayland

Aktivierte Erweiterungen:

  • Auto-Type
  • Browser-Integration
  • Passkeys
  • SSH-Agent
  • KeeShare
  • YubiKey
  • Secret-Service-Integration

Kryptographische Bibliotheken:

  • Botan 3.6.1
@loxoron218 loxoron218 added the bug label Nov 30, 2024
@droidmonkey
Copy link
Member

droidmonkey commented Nov 30, 2024

This appears to be a major bug in Qt 5 with Wayland. We cannot determine when the window is minimized or not which means we also do not handle "Hide to tray on minimize" and showing the window when minimized (ie, unminimize) also fails. I tried a lot of combinations but everything failed.

Appears to be this bug: https://bugreports.qt.io/browse/QTBUG-74310

@droidmonkey droidmonkey changed the title App fails to open immediately after automatic closing Hide to tray on minimize and activate window on launch both fail on Wayland Nov 30, 2024
@loxoron218
Copy link
Author

Weird, because the app always opens instantly when clicking on the "show window" option from the tray. The "freeze" only happens when opening the program from the GNOME app menu.

@droidmonkey
Copy link
Member

droidmonkey commented Nov 30, 2024

Show window from tray executes a totally different path in code. You will also have to click it twice, once to really hide the window and again to show it. If the window is truly hidden to tray than launching from the "start menu" properly shows the window.

The problem is the inability to unminimize. What you see as a "freeze" actually isn't. Keepassxc properly starts, sends the notice to the open application, then exits. Gnome just shows a swirly circle for 10 seconds no matter what.

@loxoron218
Copy link
Author

Is there currently a workaround for it? Or any plans to solve it in the near future? :)

@droidmonkey
Copy link
Member

droidmonkey commented Nov 30, 2024

I cannot solve it, this is a Qt bug, maybe a Qt + Wayland + Gnome bug. The method to determine if a window is minimized doesn't return the correct value.

@droidmonkey droidmonkey removed the bug label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants