From 41355a53c29bbf879da0c6ea562294fcc7ef89ff Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 28 Aug 2007 15:10:20 -0400 Subject: xace: add hooks + new access codes: core protocol input requests --- dix/grabs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dix/grabs.c') diff --git a/dix/grabs.c b/dix/grabs.c index 2210cd05e..b8d0df88d 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -58,6 +58,7 @@ SOFTWARE. #include "inputstr.h" #include "cursorstr.h" #include "dixgrabs.h" +#include "xace.h" #define BITMASK(i) (((Mask)1) << ((i) & 31)) #define MASKIDX(i) ((i) >> 5) @@ -309,6 +310,8 @@ int AddPassiveGrabToList(GrabPtr pGrab) { GrabPtr grab; + Mask access_mode = DixGrabAccess; + int rc; for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) { @@ -322,6 +325,13 @@ AddPassiveGrabToList(GrabPtr pGrab) } } + if (grab->keyboardMode == GrabModeSync || grab->pointerMode == GrabModeSync) + access_mode |= DixFreezeAccess; + rc = XaceHook(XACE_DEVICE_ACCESS, clients[CLIENT_ID(grab->resource)], + grab->device, access_mode); + if (rc != Success) + return rc; + /* Remove all grabs that match the new one exactly */ for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) { -- cgit v1.2.3