Skip to content

Commit

Permalink
Linux: Fix storing previously synchronized clipboard
Browse files Browse the repository at this point in the history
Fixes #2630
  • Loading branch information
hluk committed Apr 17, 2024
1 parent 6545b62 commit bc5d8e6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/clipboardmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ namespace {

bool hasSameData(const QVariantMap &data, const QVariantMap &lastData)
{
// Detect change also in case the data is unchanged but previously copied
// by CopyQ and now externally. This solves storing a copied text which was
// previously synchronized from selection to clipboard via CopyQ.
if (
!lastData.value(mimeOwner).toByteArray().isEmpty()
&& data.value(mimeOwner).toByteArray().isEmpty()
)
{
return false;
}

for (auto it = lastData.constBegin(); it != lastData.constEnd(); ++it) {
const auto &format = it.key();
if ( !format.startsWith(COPYQ_MIME_PREFIX)
Expand Down

0 comments on commit bc5d8e6

Please sign in to comment.