Xephyr: replace XKeycodeToKeysym with xcb-keysyms

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
Julien Cristau 2010-06-24 23:26:48 +01:00 committed by Eric Anholt
parent 8543d3fdfd
commit 126312fb4a
2 changed files with 9 additions and 6 deletions

View File

@ -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

View File

@ -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>
@ -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);