mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
@@ -21,6 +21,7 @@
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
|
||||
#include "core/Config.h"
|
||||
@@ -101,6 +102,12 @@ void Clipboard::clearCopiedText()
|
||||
|| m_lastCopied == clipboard->text(QClipboard::Selection)) {
|
||||
clipboard->clear(QClipboard::Clipboard);
|
||||
clipboard->clear(QClipboard::Selection);
|
||||
#ifdef Q_OS_UNIX
|
||||
// Gnome Wayland doesn't let apps modify the clipboard when not in focus, so force clear
|
||||
if (QProcessEnvironment::systemEnvironment().contains("WAYLAND_DISPLAY")) {
|
||||
QProcess::startDetached("wl-copy", {"-c"});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
m_lastCopied.clear();
|
||||
|
||||
Reference in New Issue
Block a user