Commit 9d8e7c48 authored by Ignacio Casal Quinteiro's avatar Ignacio Casal Quinteiro Committed by Peter Hutterer
Browse files

XKB: Add debug key actions for grabs & window tree

Replicate 7d2543a3 but for
all types of X servers
parent c24eb7e3
......@@ -30,23 +30,6 @@ XkbDDXPrivate(DeviceIntPtr dev, KeyCode key, XkbAction *act)
xf86ProcessActionEvent(ACTION_PREV_MODE, NULL);
else if (strcasecmp(msgbuf, "+vmode") == 0)
xf86ProcessActionEvent(ACTION_NEXT_MODE, NULL);
else if (strcasecmp(msgbuf, "prgrbs") == 0) {
DeviceIntPtr tmp;
xf86Msg(X_INFO, "Printing all currently active device grabs:\n");
for (tmp = inputInfo.devices; tmp; tmp = tmp->next)
if (tmp->deviceGrab.grab)
PrintDeviceGrabInfo(tmp);
xf86Msg(X_INFO, "End list of active device grabs\n");
PrintPassiveGrabs();
}
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;
......
......@@ -43,6 +43,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "mi.h"
#include "mipointer.h"
#include "inpututils.h"
#include "dixgrabs.h"
#define EXTENSION_EVENT_BASE 64
DevPrivateKeyRec xkbDevicePrivateKeyRec;
......@@ -992,6 +993,45 @@ _XkbFilterSwitchScreen(XkbSrvInfoPtr xkbi,
return 1;
}
static int
XkbHandlePrivate(DeviceIntPtr dev, KeyCode keycode, XkbAction *pAction)
{
XkbAnyAction *xkb_act = &(pAction->any);
if (xkb_act->type == XkbSA_XFree86Private) {
char msgbuf[XkbAnyActionDataSize + 1];
memcpy(msgbuf, xkb_act->data, XkbAnyActionDataSize);
msgbuf[XkbAnyActionDataSize] = '\0';
if (strcasecmp(msgbuf, "prgrbs") == 0) {
DeviceIntPtr tmp;
LogMessage(X_INFO, "Printing all currently active device grabs:\n");
for (tmp = inputInfo.devices; tmp; tmp = tmp->next)
if (tmp->deviceGrab.grab)
PrintDeviceGrabInfo(tmp);
LogMessage(X_INFO, "End list of active device grabs\n");
PrintPassiveGrabs();
}
else if (strcasecmp(msgbuf, "ungrab") == 0) {
LogMessage(X_INFO, "Ungrabbing devices\n");
UngrabAllDevices(FALSE);
}
else if (strcasecmp(msgbuf, "clsgrb") == 0) {
LogMessage(X_INFO, "Clear grabs\n");
UngrabAllDevices(TRUE);
}
else if (strcasecmp(msgbuf, "prwins") == 0) {
LogMessage(X_INFO, "Printing window tree\n");
PrintWindowTree();
}
}
return XkbDDXPrivate(dev, keycode, pAction);
}
static int
_XkbFilterXF86Private(XkbSrvInfoPtr xkbi,
XkbFilterPtr filter, unsigned keycode, XkbAction *pAction)
......@@ -1006,7 +1046,7 @@ _XkbFilterXF86Private(XkbSrvInfoPtr xkbi,
filter->active = 1;
filter->filterOthers = 0;
filter->filter = _XkbFilterXF86Private;
XkbDDXPrivate(dev, keycode, pAction);
XkbHandlePrivate(dev, keycode, pAction);
return 0;
}
else if (filter->keycode == keycode) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment