From 3304d24bea47d0de9a7f841fde517695ad4d6e6f Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Mon, 12 May 2025 19:16:23 -0400
Subject: [PATCH] Revert "x11: Filter out duplicate key presses when an IME is
active"
This reverts commit f4813ca2cf9953f60ec406ab63e07bd68f56c4ee.
---
src/video/x11/SDL_x11events.c | 8 ++------
src/video/x11/SDL_x11video.h | 2 --
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c
index 364e05a77988f..a4e5d9caf67a3 100644
--- a/src/video/x11/SDL_x11events.c
+++ b/src/video/x11/SDL_x11events.c
@@ -988,11 +988,8 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
}
if (pressed) {
- // Duplicate events may be sent when an IME is active; don't send multiple keydown events for the same serial.
- if (videodata->last_key_down_serial != xevent->xkey.serial) {
- X11_HandleModifierKeys(videodata, scancode, true, true);
- SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, true);
- }
+ X11_HandleModifierKeys(videodata, scancode, true, true);
+ SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, true);
// Synthesize a text event if the IME didn't consume a printable character
if (*text && !(SDL_GetModState() & (SDL_KMOD_CTRL | SDL_KMOD_ALT))) {
@@ -1002,7 +999,6 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
}
X11_UpdateUserTime(windowdata, xevent->xkey.time);
- videodata->last_key_down_serial = xevent->xkey.serial;
} else {
if (X11_KeyRepeat(display, xevent)) {
// We're about to get a repeated key down, ignore the key up
diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h
index d5a9299b4eea1..a336a800f598f 100644
--- a/src/video/x11/SDL_x11video.h
+++ b/src/video/x11/SDL_x11video.h
@@ -140,8 +140,6 @@ struct SDL_VideoData
int xinput_master_pointer_device;
bool xinput_hierarchy_changed;
- unsigned long last_key_down_serial;
-
int xrandr_event_base;
struct
{