summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c50
1 files changed, 18 insertions, 32 deletions
diff --git a/dix/events.c b/dix/events.c
index c8da7d62c..7cfe0ad0c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -137,9 +137,7 @@ of the copyright holder.
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
#endif
-#ifdef XACE
#include "xace.h"
-#endif
#ifdef XSERVER_DTRACE
#include <sys/types.h>
@@ -2462,10 +2460,8 @@ CheckPassiveGrabsOnWindow(
(grab->confineTo->realized &&
BorderSizeNotEmpty(grab->confineTo))))
{
-#ifdef XACE
if (!XaceHook(XACE_DEVICE_ACCESS, wClient(pWin), device, FALSE))
return FALSE;
-#endif
#ifdef XKB
if (!noXkbExtension) {
XE_KBPTR.state &= 0x1f00;
@@ -2826,9 +2822,7 @@ drawable.id:0;
if (deactivateGrab)
(*keybd->DeactivateGrab)(keybd);
-#ifdef XACE
XaceHook(XACE_KEY_AVAIL, xE, keybd, count);
-#endif
}
#ifdef XKB
@@ -3252,17 +3246,13 @@ EnterLeaveEvent(
if ((type == EnterNotify) && (mask & KeymapStateMask))
{
xKeymapEvent ke;
-
-#ifdef XACE
ClientPtr client = grab ? rClient(grab)
: clients[CLIENT_ID(pWin->drawable.id)];
- if (!XaceHook(XACE_DEVICE_ACCESS, client, keybd, FALSE))
- {
- bzero((char *)&ke.map[0], 31);
- }
+ if (XaceHook(XACE_DEVICE_ACCESS, client, keybd, FALSE))
+ memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31);
else
-#endif
- memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31);
+ bzero((char *)&ke.map[0], 31);
+
ke.type = KeymapNotify;
if (grab)
(void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask,
@@ -3348,15 +3338,12 @@ FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr
((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask))
{
xKeymapEvent ke;
-#ifdef XACE
ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)];
- if (!XaceHook(XACE_DEVICE_ACCESS, client, dev, FALSE))
- {
- bzero((char *)&ke.map[0], 31);
- }
+ if (XaceHook(XACE_DEVICE_ACCESS, client, dev, FALSE))
+ memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31);
else
-#endif
- memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31);
+ bzero((char *)&ke.map[0], 31);
+
ke.type = KeymapNotify;
(void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1,
KeymapStateMask, NullGrab, 0);
@@ -3619,10 +3606,10 @@ ProcSetInputFocus(client)
REQUEST(xSetInputFocusReq);
REQUEST_SIZE_MATCH(xSetInputFocusReq);
-#ifdef XACE
+
if (!XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE))
return Success;
-#endif
+
return SetInputFocus(client, inputInfo.keyboard, stuff->focus,
stuff->revertTo, stuff->time, FALSE);
}
@@ -3884,18 +3871,17 @@ ProcGrabKeyboard(ClientPtr client)
int result;
REQUEST_SIZE_MATCH(xGrabKeyboardReq);
-#ifdef XACE
- if (!XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE))
- {
+
+ if (XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE))
+ result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode,
+ stuff->pointerMode, stuff->grabWindow,
+ stuff->ownerEvents, stuff->time,
+ KeyPressMask | KeyReleaseMask, &rep.status);
+ else {
result = Success;
rep.status = AlreadyGrabbed;
}
- else
-#endif
- result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode,
- stuff->pointerMode, stuff->grabWindow,
- stuff->ownerEvents, stuff->time,
- KeyPressMask | KeyReleaseMask, &rep.status);
+
if (result != Success)
return result;
rep.type = X_Reply;