keepassxreboot / keepassxc

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

AutoType not available when using Wayland #2281

Open ganomi46 opened 6 years ago

ganomi46 commented 6 years ago

Expected Behavior

AutoType should be available as under X.

Current Behavior

AutoType not available in Wayland

Steps to Reproduce (for bugs)

Login to Plasma Wayland Open KeePassXC You will there are no auto login options

Operating system: OS Debian SID amd64

dasistwas commented 3 months ago

On Ubuntu 24.04 I used to start keepassxc withQT_QPA_PLATFORM=xcb /snap/bin/keepassxc -platform xcb %f That worked for a week and now AutoType is gone again. Snap version of keepassxc is 2.7.8, then I tried the AppImage, but here it is the same (2.7.9) - AutoType does not work.

Launching AppImage:

./KeePassXC-2.7.9-x86_64.AppImage 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QObject::startTimer: Timers cannot have negative intervals
qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate

Launching snap:


QT_QPA_PLATFORM=xcb /snap/bin/keepassxc -platform xcb %f
Qt: Session management error: Could not open network socket
MESA: warning: Driver does not support the 0x7d55 PCI ID.
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: iris
Ironwally commented 3 months ago

I found this issue after installing keepassxc via snap. Up to now I used keepassxc via appimage. Here I did not have any issues or needed workarounds. So maybe it would be interessting to know why this works with the appimage, but not with, I suppose, the rest?

You mean to say that Auto type works in wayland session when run as app image? Because I tried & there is no Autotype option.

Can you confirm if you were in Wayland/X11 session?

Yes, I am using wayland. I never specified any options like -platform or something. I just downloaded the app and started it. Out of the box it worked fine.

I'll check if theres some argument run automatically when starting via appimage.

Ironwally commented 3 months ago

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

Interesting, your startup errors for the appimage.

Mine is slightly different and makes me think that mine is actually running with xcb. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" But I don't know how to interprete this one. It seems to want to load wayland, but doesn't give the same error as yours.

ioogithub commented 2 months ago

When I run KeePassXC from the terminal using the command keepassxc -platform xcb I have get the auto type options enabled again (I know this is supposed to work). I am on KDE Plasma 6 running Wayland and am able to use the autotype function when in this mode to type into even what should be Wayland windows (Konsole, Kate, Kwrite, Firefox) after accepting a dialogue box which asks me to accept a remote control request. Screenshot_20240722_120525 The dialogue box only shows up once per Plasma session (which I think is fine).

This dialogue box is relatively new (maybe a month or so) auto-type would only work with X11 apps running in XWayland (I used to auto-type into Chromium) before I noticed this dialogue box. Hope this workaround helps anyone while the PR to get this properly implemented.

How exactly do you get this dialogue box to pop up? I have been trying to get autotype for wayland on plasma6 working for over a month.

If I start keepass with the -platform xcb argument as per the documentation then yes I can get the auto type tab however no apps, Wayland xwayland or otherwise actually work.

I never get any window asking for permission, When I press the global autotype shortcut in any window aside frim keepass itself, I don't see any errors it just does not work. If I try the Entry-Level Auto-Type, same result, I select the entry, keepassxc window minimizes then nothing previous window appears however it does not get any password.

I am currently on KDE Plasma 6.1.3. I would love to get this working it is perpahs the last major app that does not work with this environment.

q-wertz commented 2 months ago

For me the Auto-Type started working "magically" a few weeks ago.

I first get a pop-up from keepass, then one from the OS asking for permission and after confirming I can use autotype. I'm on Wayland with gnome 46 (gdm 46.2-3)

Other maybe relevant packages:

KeepassXC is installed via yay (not as flatpak) and keepassxc is started without any command line parameters/arguments (as far as I know)

arigit commented 2 months ago

When I run KeePassXC from the terminal using the command keepassxc -platform xcb I have get the auto type options enabled again (I know this is supposed to work). I am on KDE Plasma 6 running Wayland and am able to use the autotype function when in this mode to type into even what should be Wayland windows (Konsole, Kate, Kwrite, Firefox) after accepting a dialogue box which asks me to accept a remote control request. Screenshot_20240722_120525 The dialogue box only shows up once per Plasma session (which I think is fine). This dialogue box is relatively new (maybe a month or so) auto-type would only work with X11 apps running in XWayland (I used to auto-type into Chromium) before I noticed this dialogue box. Hope this workaround helps anyone while the PR to get this properly implemented.

How exactly do you get this dialogue box to pop up? I have been trying to get autotype for wayland on plasma6 working for over a month.

If I start keepass with the -platform xcb argument as per the documentation then yes I can get the auto type tab however no apps, Wayland xwayland or otherwise actually work.

I never get any window asking for permission, When I press the global autotype shortcut in any window aside frim keepass itself, I don't see any errors it just does not work. If I try the Entry-Level Auto-Type, same result, I select the entry, keepassxc window minimizes then nothing previous window appears however it does not get any password.

I am currently on KDE Plasma 6.1.3. I would love to get this working it is perpahs the last major app that does not work with this environment.

Same experience on Ubuntu 24.04.1, both firefox and keepassxc (2.7.9) installed as flatpaks. I added "QT_QPA_PLATFORM=xcb" to keepassxc enviroment via flatseal. The Autotype tab shows, but autotype is not working at all, from either global key or triggered from the menu context when right-clicking a DB entry

ag-gaphp commented 2 months ago

I'm on Arch, using KDE/Plasma

When installed via Discover/Flatpak, I can't get the auto-type tab to appear under any circumstance. Have tried setting the env var and adding the command flag to no avail.

When installed via pacman (kxc v2.7.9), the auto-type tab is already there by default, and when the database is locked it picks up the global hotkey I have set, asking to unlock the database. However, once unlocked, auto-type does nothing. I still tried adding -platform xcd to the command arguments, and setting QT_QPA_PLATFORM=xcb, but neither changes the behavior.

I get this log output when I start keepassxc (installed via pacman) without any arguments:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
droidmonkey commented 2 months ago

https://ardasevinc.hashnode.dev/launch-flatpak-apps-with-custom-args-and-environment-variables

q-wertz commented 2 months ago

I'm on Arch, using KDE/Plasma

On my Manjaro/Gnome installation via yay AutoType is working and I get

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

when starting keepassxc

It seems to run in Xwayland mode and the error (that also @dasistwas has) seems to be unrelated.

EDIT: BTW: When I use keepassxc -platform xcb AutoType works directly without the OS asking beforehand for permission.

agowa commented 2 months ago

BTW: When I use keepassxc -platform xcb AutoType works directly without the OS asking beforehand for permission

I had to grant permission. That's probably because you already granted it...

q-wertz commented 2 months ago

I had to grant permission. That's probably because you already granted it...

No... After closing the permission is lost and I have to regrant it when using it without -xbc. Also there is a "sharing" indication icon when the permission is granted (like with microphone and camera)

arigit commented 2 months ago

When I run KeePassXC from the terminal using the command keepassxc -platform xcb I have get the auto type options enabled again (I know this is supposed to work). I am on KDE Plasma 6 running Wayland and am able to use the autotype function when in this mode to type into even what should be Wayland windows (Konsole, Kate, Kwrite, Firefox) after accepting a dialogue box which asks me to accept a remote control request. Screenshot_20240722_120525 The dialogue box only shows up once per Plasma session (which I think is fine). This dialogue box is relatively new (maybe a month or so) auto-type would only work with X11 apps running in XWayland (I used to auto-type into Chromium) before I noticed this dialogue box. Hope this workaround helps anyone while the PR to get this properly implemented.

How exactly do you get this dialogue box to pop up? I have been trying to get autotype for wayland on plasma6 working for over a month. If I start keepass with the -platform xcb argument as per the documentation then yes I can get the auto type tab however no apps, Wayland xwayland or otherwise actually work. I never get any window asking for permission, When I press the global autotype shortcut in any window aside frim keepass itself, I don't see any errors it just does not work. If I try the Entry-Level Auto-Type, same result, I select the entry, keepassxc window minimizes then nothing previous window appears however it does not get any password. I am currently on KDE Plasma 6.1.3. I would love to get this working it is perpahs the last major app that does not work with this environment.

Same experience on Ubuntu 24.04.1, both firefox and keepassxc (2.7.9) installed as flatpaks. I added "QT_QPA_PLATFORM=xcb" to keepassxc enviroment via flatseal. The Autotype tab shows, but autotype is not working at all, from either global key or triggered from the menu context when right-clicking a DB entry

An update on this: there is an ugly workaround that can be used in wayland for keepassxc (flatpak) and firefox (flatpak) autotype to work: running both on xwayland, this is easy to achieve using Flatseal and removing the "Wayland Socket" permission from both Firefox and KeepassXC. Global autotype works well, as expected. Ubuntu 22.04 / nvidia 555

Of course, doing that is bad specially for firefox, it's back to the past (not as smooth (noticeably) browsing pages, security implications etc). So truly hopeful we will get native wayland autotype via a portal working sometime soon. In my environment could not manage yet to get the "prompt" that some folks report above.

e-pirate commented 1 month ago

Recently Gentoo marked Plasma 6 as Stable and masked KDE/Plasma 5 forcing users to update. I faced numerous problems with Wayland even it is Plasma version 6.1. Some were solved, some can be with a little bit of effort, some can be ignored or accepted. But non working AutoType function of KeepAssXC is an absolute blocker for me. Been a duty system administrator on I huge production, I'm forced to use AutoType in various combination primly for login into Windows machines via xfreerdp (we all hate this), typing in root passwords in IPMI sessions for rescuing stack servers and dozens of other scenarios when browser is no use and only AutoType is a solution. Having non-working AutoType simply making impossible to use Wayland. So we have:

tukanos commented 1 month ago

Recently Gentoo marked Plasma 6 as Stable and masked KDE/Plasma 5 forcing users to update. I faced numerous problems with Wayland even it is Plasma version 6.1. Some were solved, some can be with a little bit of effort, some can be ignored or accepted. But non working AutoType function of KeepAssXC is an absolute blocker for me. Been a duty system administrator on I huge production, I'm forced to use AutoType in various combination primly for login into Windows machines via xfreerdp (we all hate this), typing in root passwords in IPMI sessions for rescuing stack servers and dozens of other scenarios when browser is no use and only AutoType is a solution. Having non-working AutoType simply making impossible to use Wayland. So we have:

* wayland-1.23.0-r1

* keepassxc-2.7.9

* qtbase-6.7.2

* xcb-util-keysyms-0.4.1

* plasma-workspace-6.1.4-r1
  If I start `keepassxc -platform xcb` I can now see the AutoType menu, but as many others when I select something there or just hit Ctrl-Shift-V, keepassxc window get minimized, but nothing typed into previous window and no 'Remote control request' window appear.
  Any ideas what is wrong?

I see the issue somewhere between the Wayland/X compatibility layer.

kde-baskets-user commented 1 month ago

May I kindly ask someone to summarize in precise, technical terms the current status of the Auto-type feature on Wayland?

You'd help enormously many users by clarifying things.

mareksamec commented 1 month ago

May I kindly ask someone to summarize in precise, technical terms the current status of the Auto-type feature on Wayland?

  • Does Auto-type support pure Wayland mode? Does it support both Plasma 6 and Gnome? If so, how was it implemented?
  • Does the PR linked somewhere above address this issue and what's its fate?
  • If it's not supported, please provide command line options to enable the Xwayland workaround for both Gnome and KDE Plasma 6.
  • Do native, flatpack or snap installations make any difference in this regard?

You'd help enormously many users by clarifying things.

I just tried KeePassXC 2.7.9 running on the Plasma 6 and Arch linux versions bellow and it works out of the box. What I needed to do is autostart my keepassxc with this argument keepassxc -platform xcb or start it with env variable like this QT_QPA_PLATFORM=xcb keepassxc. If your distro has recent enough version, it should work. Regarding flatpak or snaps. I'm not using those, but this comment above seems to explain how to make it work on flatpak.

Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.10-arch1-1 (64-bit)
e-pirate commented 1 month ago

@mareksamec no, it does not work that way. I have all Plasma components equal or grater then 6.1.5, qtbase-6.7.2-r4, kde-frameworks 6.5.0 and running keepasxc with `-platform xcb' does not make autotype work, just enables the menu option back. Maybe frameworks are older then needed...

tmccombs commented 1 month ago

I think with the xcb platform it will work for other applications using Xwayland, but not native wayland applications.

ag-gaphp commented 1 month ago

May I kindly ask someone to summarize in precise, technical terms the current status of the Auto-type feature on Wayland?

  • Does Auto-type support pure Wayland mode? Does it support both Plasma 6 and Gnome? If so, how was it implemented? A: It does not

  • Does the PR linked somewhere above address this issue and what's its fate? A: You can always get the latest info from the PR itself. TL;DR: it's not ready yet, as it is still in open status.

  • If it's not supported, please provide command line options to enable the Xwayland workaround for both Gnome and KDE Plasma 6. A: There are none

  • Do native, flatpack or snap installations make any difference in this regard? A: Makes no difference

You'd help enormously many users by clarifying things.

I get it's a long thread, but these are all pretty well clarified in the latest comments already. I went ahead and answered inline though.

If you need auto-type over anything else, use pure X11 instead of any wayland.

odomingao commented 1 month ago

Hi, anyone got it to work with hyprland?