Add Set::exclude_from_history on linux by setting x-kde-passwordManagerHint#155
Add Set::exclude_from_history on linux by setting x-kde-passwordManagerHint#155complexspaces merged 2 commits into1Password:masterfrom
Conversation
complexspaces
left a comment
There was a problem hiding this comment.
Thank you for this PR! The structure of it looks good. My suggestions are just minor code quality ones.
I would like to test this out for myself (probably tomorrow) but I once this is cleaned up I think its ready.
|
I just noticed that it didn't work properly for me without ... and I am not sure what to do about the CI-failure |
IIRC Plasma defaults to Wayland these days. Do you know if
This looks like a new lint from the latest stable Rust release. At the top of the |
|
I tried a little, and I wasn't able to properly solve the new CI-Issue |
|
I spent several hours tonight trying to test this out, with mixed results. This seems to work fine in Plasma Wayland like you observed, but GNOME/Ubuntu were a mess. In my testing there, I used pano as a clipboard monitor. GNOME apparently doesn't support the wayland extension that Next testing in a GNOME X11 environment, I still couldn't get it to work with this PR. KeePassXC works fine. From what I can see, it works while the process using I'm not sure how to proceed here. It doesn't feel right to merge this when it can't be confirmed working-as-intended. I most likely will not have the time to continue digging into the X11 behavior in-depth because there's so many moving parts. Do you have interest in doing so @MrSmoer? |
|
I already started looking into the way the clipboard data flows, but could really wrap my head around it. The whole stack on gnome seems very convoluted to me, especially in connection with Xwayland and stuff. I dont have thaaat much time to spare, so this is going to be on my list of side-projects. I am not sure what would have to change in the ecosystem but I believe that it's just the way arboard interfaces with the x11-package or within the x11 rust-package. It would take some time :) |
da310d2 to
fe41c16
Compare
|
Hey again! I'm following up here with the intent to merge this branch now that I've resolved the last outstanding issue from my prior testing. I was doing some other clipboard stuff the last few weeks and ended up getting a lot of helpful context to investigate what was happening here. I apologize that this sat for so long but I didn't have any motivation or additional knowledge to revisit this until last week.
To quickly document this: GUI applications utilize the
This is what I spent more time digging into. After some testing, I narrowed it down to the way we were destroying the X Window when the last I added a proper ownership relinquishment call and all the issues went away, so the GNOME clipboard manager extensions are no longer retaining excluded values. I decided to continue not doing this for non-excluded values though for two reasons:
With that I believe we have proper coverage of X11 and Wayland clipboard manager exclusions now and am happy to merge this. For transparency I swapped around the commit authors on this branch due to the amount of time and debugging I put into the functionality. You're still obviously a co-author though because of the original contribution set. |
1855043 to
2384cb4
Compare
Addresses 1Password#129 Co-authored-by: MrSmör <66489839+MrSmoer@users.noreply.github.com>
While there is no behavior difference, its more obviously correct if we only claim clipboard ownership _after_ we've written data and prepared to serve it.
complexspaces
left a comment
There was a problem hiding this comment.
Thanks again for starting on this! I also added support for excluding the other Set types and tested them on X11 with success.
|
This is all very nice to see, thank you so much for revisiting this and all the debugging effort!!
Obviously, you did the huge part of the work with the actual engineering, so that is definitely the right thing to do ^^ Thank you so much for putting in the work and doing it the proper way!! ❤️ |
|
You're very welcome 😄. I hope to have this out in a crates.io release soon once some other work wraps up. |
|
This is now released as part of 3.6.0. Thanks again! |
Fixes #129
Implements the Set::exclude_from_history method for linux.
I tested this on Plasma Wayland (they implement data control protocol) and X11 using this short rust program:
It did not display the
secretextwhen pressingSUPER+V(opens klipper) but it did display thenotsecrettextafter 10 seconds, so it works as intended.Gnome doesn't implement the data control protocol, but testing this change with
wl-paste -l(probably falling back to the xserver clipboard stuff) seemed to work as well.In contrast, using a gnome-shell-extension that hooks the the get_mimetypes-method from within the compositor for determinig the clipboard-data-content didn't seem to work properly.
With KeepassXC, which is just using Qt's-functions for handling the clipboard, this function behaved as expected on gnome from what I can tell.
I believe there is some deeper issue with the way gnome handles the clipboard in general, but I was not able to track down the specific difference between how Qt and arboard register their clipboard content to the compositor yet.
Thanks for reviewing this and have a nice Day!