diff --git a/configure.ac b/configure.ac index 2c9585d7e..db7ef7cd1 100644 --- a/configure.ac +++ b/configure.ac @@ -2116,7 +2116,7 @@ if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) fi - XEPHYR_REQUIRED_LIBS="x11 >= 1.6 $LIBXEXT xau xdmcp xcb x11-xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm" + XEPHYR_REQUIRED_LIBS="x11 >= 1.6 $LIBXEXT xau xdmcp xcb x11-xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms" if test "x$XV" = xyes; then XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv" fi diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 1261487a8..4bcc90266 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -62,6 +62,7 @@ #include #include #include +#include #ifdef XF86DRI #include #include @@ -943,6 +944,10 @@ hostx_get_event(EphyrHostXEvent * ev) { XEvent xev; static int grabbed_screen = -1; + static xcb_key_symbols_t *keysyms; + + if (!keysyms) + keysyms = xcb_key_symbols_alloc(HostX.conn); if (XPending(HostX.dpy)) { XNextEvent(HostX.dpy, &xev); @@ -1007,11 +1012,9 @@ hostx_get_event(EphyrHostXEvent * ev) return 1; } case KeyRelease: - - if ((XKeycodeToKeysym(HostX.dpy, xev.xkey.keycode, 0) == XK_Shift_L - || XKeycodeToKeysym(HostX.dpy, xev.xkey.keycode, - 0) == XK_Shift_R) - && (xev.xkey.state & ControlMask)) { + if ((xcb_key_symbols_get_keysym(keysyms,xev.xkey.keycode, 0) == XK_Shift_L + || xcb_key_symbols_get_keysym(keysyms,xev.xkey.keycode, 0) == XK_Shift_R) + && (xev.xkey.state & XCB_MOD_MASK_CONTROL)) { struct EphyrHostScreen *host_screen = host_screen_from_window(xev.xexpose.window);