summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2011-09-03 12:48:50 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-10-05 17:08:45 +0100
commit1de42a64916bcae7d40b7212d46fbf7a1c715a4a (patch)
tree9922f2df9778ed004a6fd7d73f3c7b6c125701ff
parentd054d486d9022369b949d0c983a9406ec2194836 (diff)
hw/xwin: Add XF86 xkb private actions for grab debugging to XWin
In order to invoke these actions, you will need to add them to you XKB maps, as described in [1] http://lists.x.org/archives/xorg-devel/2011-June/023508.html
-rw-r--r--hw/xwin/winkeybd.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index a3112fffe..a9a9a2dae 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -41,6 +41,7 @@
#include "winmsg.h"
#include "xkbsrv.h"
+#include "dixgrabs.h"
static Bool g_winKeyState[NUM_KEYCODES];
@@ -522,3 +523,34 @@ void winFixShiftKeys (int iScanCode)
if (iScanCode == KEY_ShiftR && g_winKeyState[KEY_ShiftL])
winSendKeyEvent (KEY_ShiftL, FALSE);
}
+
+/*
+ */
+int
+XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act)
+{
+ XkbAnyAction *xf86act = &(act->any);
+ char msgbuf[XkbAnyActionDataSize+1];
+
+ if (xf86act->type == XkbSA_XFree86Private)
+ {
+ memcpy(msgbuf, xf86act->data, XkbAnyActionDataSize);
+ msgbuf[XkbAnyActionDataSize]= '\0';
+ if (strcasecmp(msgbuf, "prgrbs")==0) {
+ DeviceIntPtr tmp;
+ winMsg(X_INFO, "Printing all currently active device grabs:\n");
+ for (tmp = inputInfo.devices; tmp; tmp = tmp->next)
+ if (tmp->deviceGrab.grab)
+ PrintDeviceGrabInfo(tmp);
+ winMsg(X_INFO, "End list of active device grabs\n");
+ }
+ else if (strcasecmp(msgbuf, "ungrab")==0)
+ UngrabAllDevices(FALSE);
+ else if (strcasecmp(msgbuf, "clsgrb")==0)
+ UngrabAllDevices(TRUE);
+ else if (strcasecmp(msgbuf, "prwins")==0)
+ PrintWindowTree();
+ }
+
+ return 0;
+}