Revert "x11: Send key events for dead keys consumed by the IME"

This and its related commits introduced some bugs and quirks such as duplicated and delayed/missed key events that can't be easily worked around, so revert this for now.

This reverts commit 47162a4168.
This commit is contained in:
Frank Praznik authored and Sam Lantinga committed 2025-05-13 09:21:39 -07:00
1 parent 3304d24bea
commit 1eeffc5933
1 file changed
+6 -3
+6 -3
View File
@@ -987,18 +987,16 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
} }
} }
if (!handled_by_ime) {
if (pressed) { if (pressed) {
X11_HandleModifierKeys(videodata, scancode, true, true); X11_HandleModifierKeys(videodata, scancode, true, true);
SDL_SendKeyboardKeyIgnoreModifiers(timestamp, keyboardID, keycode, scancode, 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))) { if (*text && !(SDL_GetModState() & (SDL_KMOD_CTRL | SDL_KMOD_ALT))) {
text[text_length] = '\0'; text[text_length] = '\0';
X11_ClearComposition(windowdata); X11_ClearComposition(windowdata);
SDL_SendKeyboardText(text); SDL_SendKeyboardText(text);
} }
X11_UpdateUserTime(windowdata, xevent->xkey.time);
} else { } else {
if (X11_KeyRepeat(display, xevent)) { if (X11_KeyRepeat(display, xevent)) {
// We're about to get a repeated key down, ignore the key up // We're about to get a repeated key down, ignore the key up
@@ -1010,6 +1008,11 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_
} }
} }
if (pressed) {
X11_UpdateUserTime(windowdata, xevent->xkey.time);
}
}
void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_MouseID mouseID, int button, float x, float y, unsigned long time) void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_MouseID mouseID, int button, float x, float y, unsigned long time)
{ {
SDL_Window *window = windowdata->window; SDL_Window *window = windowdata->window;