Skip to content

Commit bc5d8e6

Browse files
committed
Linux: Fix storing previously synchronized clipboard
Fixes #2630
1 parent 6545b62 commit bc5d8e6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/clipboardmonitor.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ namespace {
2222

2323
bool hasSameData(const QVariantMap &data, const QVariantMap &lastData)
2424
{
25+
// Detect change also in case the data is unchanged but previously copied
26+
// by CopyQ and now externally. This solves storing a copied text which was
27+
// previously synchronized from selection to clipboard via CopyQ.
28+
if (
29+
!lastData.value(mimeOwner).toByteArray().isEmpty()
30+
&& data.value(mimeOwner).toByteArray().isEmpty()
31+
)
32+
{
33+
return false;
34+
}
35+
2536
for (auto it = lastData.constBegin(); it != lastData.constEnd(); ++it) {
2637
const auto &format = it.key();
2738
if ( !format.startsWith(COPYQ_MIME_PREFIX)

0 commit comments

Comments
 (0)