x11: Revert "Fix keymap updating for X11 backend"

This reverts commit de6d290266.

This patch had multiple issues, discussed in #5520.
This commit is contained in:
Ryan C. Gordon 2022-04-19 00:36:53 -04:00
parent b9fe6ba0e7
commit 49a2e4b0ea
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
3 changed files with 5 additions and 6 deletions

View File

@ -733,9 +733,9 @@ static void
X11_DispatchEvent(_THIS, XEvent *xevent)
{
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
XkbEvent* xkbEvent = (XkbEvent*) xevent;
Display *display;
SDL_WindowData *data;
XEvent xevent;
int orig_event_type;
KeyCode orig_keycode;
XClientMessageEvent m;
@ -744,6 +744,9 @@ X11_DispatchEvent(_THIS, XEvent *xevent)
SDL_assert(videodata != NULL);
display = videodata->display;
SDL_zero(xevent); /* valgrind fix. --ryan. */
X11_XNextEvent(display, &xevent);
/* Save the original keycode for dead keys, which are filtered out by
the XFilterEvent() call below.
*/
@ -823,8 +826,7 @@ X11_DispatchEvent(_THIS, XEvent *xevent)
if (SDL_GetKeyboardFocus() != NULL) {
X11_ReconcileKeyboardState(_this);
}
} else if (xevent->type == MappingNotify ||
(xevent->type == videodata->xkb_event && xkbEvent->any.xkb_type == XkbStateNotify)) {
} else if (xevent.type == MappingNotify) {
/* Has the keyboard layout changed? */
const int request = xevent->xmapping.request;

View File

@ -185,7 +185,6 @@ SDL_X11_SYM(XkbDescPtr,XkbGetMap,(Display* a,unsigned int b,unsigned int c),(a,b
SDL_X11_SYM(void,XkbFreeClientMap,(XkbDescPtr a,unsigned int b, Bool c),(a,b,c),)
SDL_X11_SYM(void,XkbFreeKeyboard,(XkbDescPtr a,unsigned int b, Bool c),(a,b,c),)
SDL_X11_SYM(Bool,XkbSetDetectableAutoRepeat,(Display* a, Bool b, Bool* c),(a,b,c),return)
SDL_X11_SYM(Bool,XkbSelectEvents,(Display* a, unsigned int b, unsigned int c, unsigned int d),(a,b,c,d),return)
#endif
#if NeedWidePrototypes

View File

@ -678,8 +678,6 @@ X11_CreateWindow(_THIS, SDL_Window * window)
/* For _ICC_PROFILE. */
X11_XSelectInput(display, RootWindow(display, screen), PropertyChangeMask);
X11_XkbSelectEvents(display, XkbUseCoreKbd, XkbStateNotifyMask, XkbStateNotifyMask);
X11_XFlush(display);
return 0;