[client] clipboard: preserve newer Wayland selections

This commit is contained in:
Geoffrey McRae
2026-08-14 12:02:40 +10:00
parent dc2ab76c36
commit 608e85fe5d
3 changed files with 49 additions and 4 deletions

View File

@@ -339,12 +339,10 @@ static void dataDeviceHandleSelection(void * opaque,
for (enum LG_ClipboardData i = 0; i < LG_CLIPBOARD_DATA_NONE; ++i)
free(extra->mimetypes[i]);
free(extra);
/* Publishing already retired the old offer, so a delayed self-copy echo
* must not invalidate a newer local selection. */
if (!selfCopy)
waylandCBInvalidateLocal(CLIPBOARD_INVALIDATE_FORCE);
else
/* This is the compositor echoing the source we just installed. It is
* not a new local clipboard owner and must not send a provider CLEAR. */
waylandCBInvalidateLocal(CLIPBOARD_INVALIDATE_SILENT);
wl_data_offer_destroy(offer);
return;
}