Skip to content

Auto clear after timeout should be x-kde-passwordManagerHint=secret#13301

Open
morawskidotmy wants to merge 3 commits intokeepassxreboot:developfrom
morawskidotmy:develop
Open

Auto clear after timeout should be x-kde-passwordManagerHint=secret#13301
morawskidotmy wants to merge 3 commits intokeepassxreboot:developfrom
morawskidotmy:develop

Conversation

@morawskidotmy
Copy link
Copy Markdown

When copying a password from keepass the password itself was properly marked as x-kde-passwordManagerHint=secret but the clear() signal wasnt which caused keepass to clear phones clipboard through kde connect. Changed it to be marked as secret as well to prevent that. I dont know if there is another way to use qclipboard clear function with mime metadata but that'd prolly be a better solution.

Screenshots

Testing strategy

Built and ran current development branch, which yielded the same effect as ver 2.7.10 which im using currently (clear() sent to my phone). Built and ran version with changed code and confirmed the correct result eg. password nor clear() get sent to the phone.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

Copilot AI review requested due to automatic review settings May 2, 2026 09:15
@morawskidotmy morawskidotmy marked this pull request as draft May 2, 2026 09:18
@morawskidotmy morawskidotmy changed the title Auto clear after timeout should be x-kde-passwordManagerHint=secre Auto clear after timeout should be x-kde-passwordManagerHint=secret May 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the clipboard auto-clear behavior in the Qt GUI layer to ensure the “clear clipboard after timeout” operation is also treated as secret data on KDE (preventing KDE Connect from propagating a clear event to connected devices).

Changes:

  • Replaced direct QClipboard::clear() calls with setText("", false) so the clear operation goes through the secret-tagging path.
  • On Unix/Wayland, only invokes wl-copy -c if the in-process clear attempt didn’t actually change the clipboard contents.

Comment thread src/gui/Clipboard.cpp Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/gui/Clipboard.cpp
Comment thread src/gui/Clipboard.cpp Outdated
@morawskidotmy morawskidotmy marked this pull request as ready for review May 2, 2026 09:52
@morawskidotmy morawskidotmy requested a review from droidmonkey May 3, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants