Skip to content

Commit f540de8

Browse files
committed
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.
1 parent 143f65c commit f540de8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/video/wayland/SDL_waylandclipboard.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ bool Wayland_SetClipboardData(SDL_VideoDevice *_this)
4040
seat = wl_container_of(video_data->seat_list.next, seat, link);
4141
}
4242

43+
video_data->last_incoming_data_offer_seat = seat;
44+
4345
if (seat && seat->data_device) {
4446
SDL_WaylandDataDevice *data_device = seat->data_device;
4547

@@ -119,6 +121,8 @@ bool Wayland_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text)
119121
seat = wl_container_of(video_data->seat_list.next, seat, link);
120122
}
121123

124+
video_data->last_incoming_primary_selection_seat = seat;
125+
122126
if (seat && seat->primary_selection_device) {
123127
SDL_WaylandPrimarySelectionDevice *primary_selection_device = seat->primary_selection_device;
124128
if (text[0] != '\0') {

0 commit comments

Comments
 (0)