keepassxreboot / keepassxc

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

Minimize to system tray not working on Wayland #6502

Open principis opened 3 years ago

principis commented 3 years ago

Overview

Keepassxc doesn't minimise to system tray on KDE with Wayland. The window minimises properly, but is still visible on the taskbar. Some other remarks:

Steps to Reproduce

  1. Use KDE with Wayland
  2. Enable "Hide window to system tray when minimised"
  3. Minimise the window...

Expected Behavior

The window shouldn't be visibible on the taskbar.

Actual Behavior

The window is still visible on the taskbar.

Context

KeePassXC - Version 2.6.4 Revision: 34a78f0 Qt: 5.15.2

Operating System: Linux (Fedora 34) Desktop Env: KDE 5.21.5 Windowing System: Wayland

droidmonkey commented 3 years ago

Sounds like either a KDE or QWayland bug to me.

principis commented 3 years ago

This seems to be related: https://bugreports.qt.io/browse/QTBUG-74310 I'm confused why this works on Gnome... Nvm, it wasn't running with wayland: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

droidmonkey commented 3 years ago

This might be something we can control though because the setting "Minimize instead of app exit", when enabled, will hide the window properly. We might not be calling the right sequence when just minimizing.

principis commented 3 years ago

@droidmonkey I've been looking in the protocol for a workaround but couldn't find anything sadly... There is no way to figure out if the application is being minimised. The only option seems to be waiting for wayland to add it to the protocol...

runiq commented 3 years ago

It's working for me on Arch Linux with kwayland 5.82.0 and kwayland-{integration,server} 5.21.5.

principis commented 3 years ago

@runiq I'm sorry, but that is impossible. There is no way of checking with the wayland protocol if the application is being minimised.

Can you make sure it is running under wayland? Try running keepassxc from a terminal, it may show errors like these:

qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

When keepassxc is launched, launch xeyes. When hovering your mouse over an X11 application the eyes should move, if it's running under wayland they won't.

You can try to force it to run with wayland like this:

$ QT_QPA_PLATFORM=wayland keepassxc
runiq commented 3 years ago

I misread—I thought the problem was a different one. Terribly sorry for the noise. :(

principis commented 3 years ago

Happens to everyone, no problem :slightly_smiling_face:

simonbcn commented 2 years ago

I opened this bug in Wayland bugtracker: https://gitlab.freedesktop.org/wayland/wayland/-/issues/337

sarlej commented 2 years ago

I installed Wayland and sway compositor on my system today and i have same issue. I think it's not releated to KDE. If i run keepassxc with QT_QPA_PLATFORM=wayland keepassxc (to be sure it runs on wayland) i have same issue as OP:

If i run keepassxc with QT_QPA_PLATFORM=xcb keepassxc (to run on x):

droidmonkey commented 2 years ago

This is almost surely a qwayland bug

samh commented 1 year ago

In case anyone missed the mention, the "Minimize instead of app exit" behavior works fine for me as a workaround.

In KDE Plasma there is also the option to use window rules ("Configure Special Application Settings"). I'm trying it with these:

tazihad commented 1 year ago

it's a won't fix in qt upstream https://bugreports.qt.io/browse/QTBUG-74310

droidmonkey commented 1 year ago

I'm really getting the sense that Wayland needs to live its own life and be wrapped by a much more useful protocol that implements all manner of desktop centric actions (including accessibility support). This should be implemented with a standard approval / security protocol.

ozeszty commented 11 months ago

Does finally implemented global keyboard shortcut portal (mentioned here: https://github.com/keepassxreboot/keepassxc/issues/2281#issuecomment-1183006029) improve situation with that bug?

droidmonkey commented 11 months ago

Not in the slightest