From f540de87b90b5a7912cf1037e34eb5d36f4bbd91 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Thu, 18 Sep 2025 17:29:54 -0400 Subject: [PATCH] wayland: Always set the last incoming clipboard seat when setting clipboard data Otherwise, the clipboard will report having no or old data until events are pumped. Fixes the automated clipboard tests. --- src/video/wayland/SDL_waylandclipboard.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/wayland/SDL_waylandclipboard.c b/src/video/wayland/SDL_waylandclipboard.c index 48598876e7..f197fe692a 100644 --- a/src/video/wayland/SDL_waylandclipboard.c +++ b/src/video/wayland/SDL_waylandclipboard.c @@ -40,6 +40,8 @@ bool Wayland_SetClipboardData(SDL_VideoDevice *_this) seat = wl_container_of(video_data->seat_list.next, seat, link); } + video_data->last_incoming_data_offer_seat = seat; + if (seat && seat->data_device) { SDL_WaylandDataDevice *data_device = seat->data_device; @@ -119,6 +121,8 @@ bool Wayland_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text) seat = wl_container_of(video_data->seat_list.next, seat, link); } + video_data->last_incoming_primary_selection_seat = seat; + if (seat && seat->primary_selection_device) { SDL_WaylandPrimarySelectionDevice *primary_selection_device = seat->primary_selection_device; if (text[0] != '\0') {