From cc254d885d66d4c3499f63864b8d403e1e97f325 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 5 Jul 2023 17:15:25 -0700 Subject: [PATCH] Fixed wayland clipboard not always updating in response to Ctrl-C --- src/video/wayland/SDL_waylandevents.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 6668380453..0cbc0076d9 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1509,10 +1509,11 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, SDL_SendKeyboardKeyIgnoreModifiers(Wayland_GetKeyboardTimestamp(input, time), state == WL_KEYBOARD_KEY_STATE_PRESSED ? SDL_PRESSED : SDL_RELEASED, scancode); } + Wayland_data_device_set_serial(input->data_device, serial); + Wayland_primary_selection_device_set_serial(input->primary_selection_device, serial); + if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (has_text && !(SDL_GetModState() & SDL_KMOD_CTRL)) { - Wayland_data_device_set_serial(input->data_device, serial); - Wayland_primary_selection_device_set_serial(input->primary_selection_device, serial); if (!handled_by_ime) { SDL_SendKeyboardText(text); }