diff --git a/include/ts_xlib.h b/include/ts_xlib.h index 5a100f97c78..43e390c2ef9 100644 --- a/include/ts_xlib.h +++ b/include/ts_xlib.h @@ -93,6 +93,7 @@ extern int TSXPending(Display*); extern int TSXPutBackEvent(Display*, XEvent*); extern int TSXPutImage(Display*, Drawable, GC, XImage*, int, int, int, int, unsigned int, unsigned int); extern int TSXQueryColor(Display*, Colormap, XColor*); +extern int TSXQueryKeymap(Display*, char*); extern int TSXQueryPointer(Display*, Window, Window*, Window*, int*, int*, int*, int*, unsigned int*); extern int TSXQueryTree(Display*, Window, Window*, Window*, Window**, unsigned int*); extern int TSXResetScreenSaver(Display*); diff --git a/tools/make_X11wrappers b/tools/make_X11wrappers index 1a1c08bd973..cfbe8994de8 100755 --- a/tools/make_X11wrappers +++ b/tools/make_X11wrappers @@ -173,6 +173,9 @@ END } if(m'\s*([^,]*[^, \t])\s*(,?\n)') { $args[$#args+1] = $1; + if ($1 =~ /char\s*\[/) { # small hack for XQueryKeymap + $args[$#args] = "char*"; + } } } # Skip if vararg, function pointer arg, or not needed. diff --git a/tsx11/X11_calls b/tsx11/X11_calls index 3fe237062de..6e930a2e847 100644 --- a/tsx11/X11_calls +++ b/tsx11/X11_calls @@ -101,6 +101,7 @@ XPolygonRegion XPutBackEvent XPutImage XQueryColor +XQueryKeymap XQueryPointer XQueryTree XReconfigureWMWindow diff --git a/tsx11/ts_xlib.c b/tsx11/ts_xlib.c index 117c7364370..f34546cbe22 100644 --- a/tsx11/ts_xlib.c +++ b/tsx11/ts_xlib.c @@ -908,6 +908,17 @@ int TSXQueryColor(Display* a0, Colormap a1, XColor* a2) return r; } +int TSXQueryKeymap(Display* a0, char* a1) +{ + int r; + TRACE(x11, "Call XQueryKeymap\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XQueryKeymap(a0, a1); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XQueryKeymap\n"); + return r; +} + int TSXQueryPointer(Display* a0, Window a1, Window* a2, Window* a3, int* a4, int* a5, int* a6, int* a7, unsigned int* a8) { int r; diff --git a/windows/keyboard.c b/windows/keyboard.c index a5323867ce9..850e95dbbb8 100644 --- a/windows/keyboard.c +++ b/windows/keyboard.c @@ -449,7 +449,7 @@ void KEYBOARD_UpdateState ( void ) KEYLP keylp; TRACE(keyboard,"called\n"); - if (!XQueryKeymap(display, keys_return)) { + if (!TSXQueryKeymap(display, keys_return)) { ERR(keyboard,"Error getting keymap !"); return; }