SDL: X11: preserve clipboard target on failed requests

From e4ed62ee3f7d7fda8bf8e0f09e42b14a7ac11984 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hern=C3=A1n=20L=C3=B3pez?= <[EMAIL REDACTED]>
Date: Wed, 21 Oct 2026 17:06:03 -0300
Subject: [PATCH] X11: preserve clipboard target on failed requests

Keep the requested target in SelectionNotify when the clipboard
callback returns NULL. Mutter otherwise ignores the failure reply,
leaving Wayland clipboard readers waiting.

Fixes libsdl-org/SDL#16567.
---
 src/video/x11/SDL_x11events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c
index a7305d78e8ab4..b975edb5cb7fc 100644
--- a/src/video/x11/SDL_x11events.c
+++ b/src/video/x11/SDL_x11events.c
@@ -852,7 +852,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
         SDL_zero(sevent);
         sevent.xany.type = SelectionNotify;
         sevent.xselection.selection = req->selection;
-        sevent.xselection.target = None;
+        sevent.xselection.target = req->target;
         sevent.xselection.property = None; // tell them no by default
         sevent.xselection.requestor = req->requestor;
         sevent.xselection.time = req->time;