From f0f593f04b574f5e0657970b2b679912d4f07444 Mon Sep 17 00:00:00 2001
From: hwsmm <[EMAIL REDACTED]>
Date: Wed, 26 Feb 2025 04:15:24 +0900
Subject: [PATCH] Embed a description about Wayland clipboard instead of a link
Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
---
src/events/SDL_clipboardevents.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/events/SDL_clipboardevents.c b/src/events/SDL_clipboardevents.c
index 61b926bd75d21..0296ceda7eb63 100644
--- a/src/events/SDL_clipboardevents.c
+++ b/src/events/SDL_clipboardevents.c
@@ -30,7 +30,11 @@ void SDL_SendClipboardUpdate(bool owner, char **mime_types, size_t num_mime_type
{
if (!owner) {
// Clear our internal clipboard contents when external clipboard is set
- // Wayland: https://github.com/libsdl-org/SDL/issues/12152
+ /* Wayland sends a data offer to the client from which the clipboard data originated, and as there is no way
+ * to determine the origin of the offer, the clipboard must not be cleared in the case of a recursive offer,
+ * or the original data may be destroyed. Cleanup will be done in the backend when an offer cancellation
+ * event arrives.
+ */
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") != 0)
SDL_CancelClipboardData(0);