Open ganomi46 opened 6 years ago
As a follow-up, GDK_BACKEND=x11
did not seem to work and to update the Application Menu item, I had to enter env WAYLAND_DISPLAY=no keepassxc %f
in the Command
section. Hopefully that will help buy some time and still be able to test/use Wayland.
GDK_BACKEND=x11 did not seem to work
Because kpxc is a Qt app and not a GTK one. QT_QPA_PLATFORM=xcb
is the right environment variable. See https://wiki.archlinux.org/title/Wayland#Qt.
As a work around for KDE on Wayland (Debian Bookworm) is to run KeepassXC through Xwayland.
As long as you only need to auto-type into XWayland clients yes but if you need to auto-type into native Wayland clients ...
You are correct. I thought I read that Google Chrome was defaulting to Wayland (which it is not) and so when it worked I thought there was something there. Starting Chrome with Wayland did not allow AutoType to work (neither did Konsole work). I thought after a few years I would give Wayland a try, it didn't crash immediately and Dvorak now worked, but I think I will try it again in a few years.
Keyboard input is actually not the challenge here. The issue is window title harvesting and ability to read the window title to use global auto type capability. That is currently impossible through the Wayland protocol and no Wayland based compositors have exposed this as a standard or defined interface.
Maybe you can first try to implement auto-type of manually selected entry (right click -> Perfom Auto-Type). Is that a problem with Wayland because it requires focusing the previously focused window?
Yes it is for that very reason. Although we can just minimize our own window and hope the focus shifts correctly.
Just to recap, there are 3 problems related to this issue.
/dev/uinput
. See how KeePass does it https://keepass.info/%0D/help/kb/autotype_wayland.html or a comment above or some stackoverflow. Does Qt has something for this? Maybe use the clipboard instead of simulating keyboard input? Libei?Feature 1 and 2 are needed for auto-type of selected entry, 1 and 3 are needed for global auto-type. Did I missed something?
Registering a global shortcut, but that might be covered by existing Wayland api. Most likely not, which would make it desktop env specific. /dev/uinput is not an option, requires root.
Registering a global shortcut, but that might be covered by existing Wayland api. Most likely not, which would make it desktop env specific.
FWIW https://github.com/flatpak/xdg-desktop-portal/issues/624
This is also affected in Gnome (Ubuntu 22.10).
Auto-type from context menu used to work fine when running Firefox under xwayland, but even this has stopped working since 2.7.0.
Ubuntu 22.04 Beta, Keepassxc 2.7.0:
@dasistwas that is likely because Signal and Chromium are using XWayland, but Firefox, Terminal, and Thunderbird are using native wayland.
Update from Ubuntu 22.04 Beta: Suddenly auto-type started to work. But version of keepassxc did not change. It is still 2.7.1
I'd like to request the documentation at:
https://keepassxc.org/docs/KeePassXC_UserGuide.html#_auto_type
be added to. I'm on Fedora (Wayland) and it was really difficult to figure out where and how to change either the command line (-platform xcb) for my KeepassXC that was set to Autorun or the environment variable (QT_QPA_PLATFORM=xcb). Some mention of where and how would be nice.
Also, the documentation isn't clear in what KPXC is looking for with AutoType to work with applications. For instance, when I try to set it up to work with the password entry in the Virtual Machine Manager or for Grsync, the window names don't show up in KPXC's Advanced > Windows dropdown. And, no matter what I manually type in for a Window name, it doesn't work.
Ubuntu 22.04 + snap version of Firefox (Ubuntu 22.04 upgrademigrates FF to the snap version automatically): autotype works again. Did not test other programs since I only need keepass for Firefox.
Wayland is disabled by default in 22.04 because of a bug, may be that's why autotype is working?
------- Original Message ------- On Friday, April 22nd, 2022 at 8:39 AM, foobar13372 @.***> wrote:
Ubuntu 22.04 + snap version of Firefox (Ubuntu 22.04 upgrademigrates FF to the snap version automatically): autotype works again. Did not test other programs since I only need keepass for Firefox.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Wayland is disabled by default in 22.04 because of a bug, may be that's why autotype is working?
no, I am on Wayland. But just realized seems only Firefox and xwayland programs do work with autotype. Terminal does not for example.
only Firefox and xwayland programs is firefox using xwayland?
Is there any news to this? I am on sway and would like to know how I can get autotype working for firefox. Setting the xcb plattform, enables autotype, but hitting the configured shortcut from keepassxc for autotype doesnt open anything.
but hitting the configured shortcut from keepassxc for autotype doesnt open anything.
As I know it, Sway does not allow other applications to apply global shortcuts themselves and also I do not know of any Wayland protocol which would implement this. It might be required to configure the shortcut on Sway manually and trigger AutoType on KeePassXC using a command / D-Bus (which is not possible yet?)
I recently installed Ubuntu 22.04 and ran into this issue.
Firefox and Chromium apparently use XWayland, so KeePasXC's Global Auto-Type works there.
My main other use of Auto-Type is in the terminal for which I use the Terminator terminal. I use the following (hopefully temporary) workarounds to run Terminator using XWayland when using the Ctrl + Alt + T shortcut and when starting Terminator via its icon in the launcher:
Create the file ~/bin/terminator
with this code
#!/bin/sh
export WAYLAND_DISPLAY=no exec /usr/bin/terminator "$@"
- Make it executable: `chmod +x ~/bin/terminator`
Not sure if this is some Gnome garbo, but under KDE Wayland, KeepassXC doesnt even offer the Autotype option??
So I got the autotype option back, but when hitting the shortcut, there is no popup on wayland, when using it for firefox...
I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.
I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.
Did you test autotype with the terminal as well? Only xwayland programs seem to work. All wayland windows do not trigger the autotype dialogue when using the global autotype shortcut.
I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.
Did you test autotype with the terminal as well? Only xwayland programs seem to work. All wayland windows do not trigger the autotype dialogue when using the global autotype shortcut.
It doesn't work with the terminal. Triggering the autotype from the KPXC window or using the keyboard key combination, it works fine with some GUI apps like Google Chrome, but apps like FIrefox or Nautilus doesn't work.
I can confirm that auto typing is currently working in Wayland normally after the past system updates released in the past few weeks.
Did you test autotype with the terminal as well? Only xwayland programs seem to work. All wayland windows do not trigger the autotype dialogue when using the global autotype shortcut.
It doesn't work with the terminal. Triggering the autotype from the KPXC window or using the keyboard key combination, it works fine with some GUI apps like Google Chrome, but apps like FIrefox or Nautilus doesn't work.
It's just can't work with wayland app. Could you read at least few comment back before posting? https://github.com/keepassxreboot/keepassxc/issues/2281#issuecomment-831369450
Would it be possible to implement a workaround for now till xdg-desktop-portals implements a global shortcut portal.
I was thinking about making keepassxc launch with a --auto-type flag. Adding that to the list of custom shortcuts in gnome-control-panel would resolve the issue for now.
name: KeePassXC Auto-Type
command: keepassxc --auto-type
Would it be possible to implement a workaround for now till xdg-desktop-portals implements a global shortcut portal.
Can you guys at least read through the thread before pushing this again. Even if you fix the shortcut registering, you still can't find out the title of the window.
And again, the easiest way to move this issue forward is to move the already existing upstream proposals forward:
Why are people pushing this issue every week but not the real underlying issue in the upstream protocols? This is all so backwards. Quite frankly, this issue should be closed as "Won't fix" or locked until this mess is fixed in Wayland. Originally back in 2013 Wayland was meant to cut out the "useless" middleman, ironically now we end up with even more useless middlemen just to deal with basic stuff like negotiating shortcut registering or server side decorations.
This information was provided by @galaxysnail
Currently, we have the global keyboard shortcut portal and libei, which should be good enough for auto-type.
For enumerating windows, there is a foreign toplevel list protocol.
Just learned that Goldwarden is using the libportal RemoteDesktop interface for auto-type. Unsure on the actual security of that, but here it is:
https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html
https://github.com/quexten/goldwarden/blob/main/cli/autotype/libportalautotype.go
On Gnome 46, I now have a new windows asking me if I want to authorized the operation but after syaing yes, nothing more happen. Normal?
Gnome added that
It doesn't help to make AutoType working on Wayland yet?
No. KeePassXC will have to implement something new for AutoType to work on Wayland (even if what that is exactly is not clear). There's no way that KeePassXC's existing X11 code will "magically" work with Wayland someday.
I’m offering $100 for a fix to this issue at gitpay https://gitpay.me/#/task/763/auto-type-not-available-when-using-wayland If this issue is important to you, please feel free to add any amount to the bounty.
Just learned that Goldwarden is using the libportal RemoteDesktop interface for auto-type. Unsure on the actual security of that, but here it is:
https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html
https://github.com/quexten/goldwarden/blob/main/cli/autotype/libportalautotype.go
I believe that using the RemoteDesktop portal interface is fine for that, it's really just for accessing emulated inputs. The ConnectToEIS
would be used to get the fd for the compositor's EIS, and then libei can be used to actually send inputs.
See also https://libinput.pages.freedesktop.org/libei/api/index.html#sec-oeffis for liboeffis which handles the desktop portal access and just gets the libei fd.
As for window detection/focusing, ext-foreign-toplevel-list-v1
isn't really implemented anywhere yet, and activation of those foreign windows isn't close.
I’m offering $100 for a fix to this issue at gitpay https://gitpay.me/#/task/763/auto-type-not-available-when-using-wayland If this issue is important to you, please feel free to add any amount to the bounty.
Just added 50 bucks :money_with_wings:
@droidmonkey, could you please add the bounty tag and the current amount to this issue to raise more awareness? Thank you!
We don't officially back bounties anymore, but I added the tag for sport.
I am working at this currently, I'll have a WIP PR up soonish
The PR is up now, still needs work
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.
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.
The documentation already coveres this: https://keepassxc.org/docs/KeePassXC_UserGuide#_auto_type
Auto-Type will be disabled when run with a Wayland compositor on Linux. To use Auto-Type in this environment, you must set QT_QPA_PLATFORM=xcb or start KeePassXC with the -platform xcb command-line flag.
After testing this right now I only see two minor issues remaining to be fixed regarding this ticket:
I feel there is a need to explain why suddenly the XWayland -> Wayland client direction is working without changes from the Keepass side and why the problem is still only half solved:
The "Remote control requested" dialog you are seeing is a result of KDE implementing the Input Capture and Remote Desktop portal together with support for the ConnectToEIS method.
libei is a library for emulated input on Wayland and has support for a superset of the functionality that was available in the XTest extension, which KeepassXC uses to implement autotype on X11.
libei can be used as a drop-in replacement for XTest in XWayland and the README even illustrates this architecture. Note that the comment about the implementations being in PoC state is outdated, full support was merged into XWayland a year ago.
This means that the fully working path from XWayland to Wayland clients is as follows:
XTestFakeKeyEvent()
eventAs mentioned at the beginning, there are however some caveats with this:
So while the situation is certainly better than before (support for basic autotype is working in XWayland and soon in Wayland), full support like on Xorg with autotype triggered on a hotkey and automatically filtering based on window title is still far from a reality.
@vimpostor is https://wayland.app/protocols/ext-foreign-toplevel-list-v1#ext_foreign_toplevel_handle_v1:event:title part of the accessibility API? Getting information of running windows sounds like something almost every accessibility tool would need to function properly. And doesn't Wayland at least also have support for screen readers? How do they access such information then? Doesn't Orca Screen Reader already support Wayland? So aren't there already APIs that could be used?
Or is this all still a big work in progress mess?
This seems to be useful: https://espanso.org/docs/install/linux/#adding-the-required-capabilities
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?
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?
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