diff -Naur SDL2-2.0.20.orig/src/video/x11/SDL_x11events.c SDL2-2.0.20/src/video/x11/SDL_x11events.c --- SDL2-2.0.20.orig/src/video/x11/SDL_x11events.c 2022-01-07 21:29:52.000000000 -0500 +++ SDL2-2.0.20/src/video/x11/SDL_x11events.c 2025-05-04 00:13:08.010889713 -0400 @@ -1647,6 +1647,9 @@ return 1; } +static XEvent deferred_xevent; +static int defer_xevent_until = 0; + void X11_PumpEvents(_THIS) { @@ -1679,8 +1682,22 @@ /* Keep processing pending events */ while (X11_PollEvent(data->display, &xevent)) { + if(xevent.type == KeyRelease && xevent.xkey.keycode == 0x24) { + if(!defer_xevent_until) { + deferred_xevent = xevent; + defer_xevent_until = (SDL_GetTicks() + 30); + continue; + } else if(SDL_GetTicks() < defer_xevent_until) { + continue; + } else { + defer_xevent_until = 0; + } + } X11_DispatchEvent(_this, &xevent); } + if(defer_xevent_until) { + X11_XPutBackEvent(data->display, &deferred_xevent); + } #ifdef SDL_USE_IME if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ diff -Naur SDL2-2.0.20.orig/src/video/x11/SDL_x11sym.h SDL2-2.0.20/src/video/x11/SDL_x11sym.h --- SDL2-2.0.20.orig/src/video/x11/SDL_x11sym.h 2022-01-07 21:29:52.000000000 -0500 +++ SDL2-2.0.20/src/video/x11/SDL_x11sym.h 2025-05-04 00:13:42.514886466 -0400 @@ -38,6 +38,7 @@ SDL_X11_SYM(int,XChangePointerControl,(Display* a,Bool b,Bool c,int d,int e,int f),(a,b,c,d,e,f),return) SDL_X11_SYM(int,XChangeProperty,(Display* a,Window b,Atom c,Atom d,int e,int f,_Xconst unsigned char* g,int h),(a,b,c,d,e,f,g,h),return) SDL_X11_SYM(Bool,XCheckIfEvent,(Display* a,XEvent *b,Bool (*c)(Display*,XEvent*,XPointer),XPointer d),(a,b,c,d),return) +SDL_X11_SYM(Bool,XPutBackEvent,(Display* a,XEvent *b),(a,b),return) SDL_X11_SYM(int,XClearWindow,(Display* a,Window b),(a,b),return) SDL_X11_SYM(int,XCloseDisplay,(Display* a),(a),return) SDL_X11_SYM(int,XConvertSelection,(Display* a,Atom b,Atom c,Atom d,Window e,Time f),(a,b,c,d,e,f),return)