diff options
author | Julien Cristau <jcristau@debian.org> | 2010-06-24 23:26:48 +0100 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2010-07-16 20:48:38 +0100 |
commit | 0f687600506f7b13cffadf27cbe5820cfae653d0 (patch) | |
tree | e2bd8c1f6384140677aa86559aa751b6bc20ca7d | |
parent | 58868fab913be934f263c3186cef82613beb8d0f (diff) |
Xephyr: replace XKeycodeToKeysym with xcb-keysyms
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index c91b7166b..9a1ee4257 100644 --- a/configure.ac +++ b/configure.ac @@ -2061,7 +2061,7 @@ if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) fi - XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xau xdmcp xcb x11-xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm" + XEPHYR_REQUIRED_LIBS="x11 $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 a09ba36d8..1491f53ca 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -62,6 +62,7 @@ #include <xcb/shm.h> #include <xcb/xcb_image.h> #include <xcb/shape.h> +#include <xcb/xcb_keysyms.h> #ifdef XF86DRI #include <xcb/xf86dri.h> #include <xcb/glx.h> @@ -990,6 +991,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)) { @@ -1058,9 +1063,9 @@ hostx_get_event(EphyrHostXEvent *ev) } 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); |