Bug 483227 - Support ext_foreign_toplevel_list_v1
Summary: Support ext_foreign_toplevel_list_v1
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 12:04 UTC by postix
Modified: 2025-11-26 14:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description postix 2024-03-11 12:04:56 UTC
`ext_foreign_toplevel_list_v1` [1] is amongst others things [2] needed for KeePassXC to support the very popular Autotype feature under Wayland [3], which currently only works under X11.

Since kwin is about integrating Eis [4], from the server side [1] seems to be the only missing piece.
After that, the KeePassXC team can probably start integrating libei and implementing [1] in their client to finally support Autotype under Wayland.

There's also already a draft implementation for COSMIC. [5]

[1] https://wayland.app/protocols/ext-foreign-toplevel-list-v1
[2] https://github.com/flatpak/xdg-desktop-portal/issues/304#issuecomment-1784049089
[3] https://github.com/keepassxreboot/keepassxc/issues/2281#issuecomment-1890576211
Comment 1 postix 2024-03-11 12:06:03 UTC
[4] https://invent.kde.org/plasma/kwin/-/merge_requests/5412
[5] https://github.com/pop-os/cosmic-comp/pull/76

(I had to split it into 2 posts as otherwise the spam detection throw a false-positive)
Comment 2 Zamundaaa 2024-03-11 15:01:22 UTC
This sounds a lot like a workaround for missing password manager APIs. I don't think that's a good approach.
Comment 3 postix 2024-03-11 15:19:44 UTC
> I don't think that's a good approach.
fair

> missing password manager APIs.
Could you please explain it a little bit more, how the API should/could look like?
I think someone (TM) should communicate that then to KeePassXC team to work it further out.
Comment 4 Zamundaaa 2024-03-11 18:47:13 UTC
For example, a password manager API should make sure that the input actually goes into the right window - with libei you just get global input, but if some other window pops up during the "typing", it would just type into the wrong window.

Likewise I think it would be good to have an actual password manager API for apps to opt into good password store handling. Maybe it could be done similar to input methods - the trusted password manager, which is set in system settings and started by the compositor, can get and set username + password combinations, and the compositor could manually input text instead if the app doesn't support the API.

I don't really have any time to work on anything like that myself right now though
Comment 5 postix 2025-11-26 13:38:24 UTC
Short update, there's a MR  https://github.com/keepassxreboot/keepassxc/pull/10905, which states

> Window detection isn't implemented, as there's no cross-platform way
> to do this on Wayland currently, but could be done in the future for some platforms 
> (i.e. wlr-foreign-toplevel-management, KWin scripts, etc.)

> As a consequence of the last point, activation of foreign windows isn't possible,
> so typing occurring in the correct window relies on it being automatically activated
> when the application window is deactivated
Comment 6 postix 2025-11-26 14:38:02 UTC
(In reply to Zamundaaa from comment #4)
> Likewise I think it would be good to have an actual password manager API for
> apps to opt into good password store handling. 

You are absolutely right, the linked MR above sounds like an awful hack - utilizing a Remote Desktop Session in order to type passwords in other windows ...

> I don't really have any time to work on anything like that myself right now though
Too bad, some needs to shim in! :)