diff --git a/Xext/xace.c b/Xext/xace.c index bfd428d32..eaeeb3657 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -116,6 +116,13 @@ int XaceHookServerAccess(ClientPtr client, Mask access_mode) return rec.status; } +int XaceHookScreenAccess(ClientPtr client, ScreenPtr screen, Mask access_mode) +{ + XaceScreenAccessRec rec = { client, screen, access_mode, Success }; + CallCallbacks(&XaceHooks[XACE_SCREEN_ACCESS], &rec); + return rec.status; +} + /* Entry point for hook functions. Called by Xserver. */ int @@ -140,7 +147,6 @@ XaceHook(int hook, ...) * sets calldata directly to a single argument (with no return result) */ switch (hook) { - case XACE_SCREEN_ACCESS: case XACE_SCREENSAVER_ACCESS: u.screen.client = va_arg(ap, ClientPtr); u.screen.screen = va_arg(ap, ScreenPtr); diff --git a/Xext/xace.h b/Xext/xace.h index 8cabb8e98..7ab2dfd21 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -93,6 +93,7 @@ int XaceHookReceiveAccess(ClientPtr client, WindowPtr win, xEventPtr ev, int cou int XaceHookClientAccess(ClientPtr client, ClientPtr target, Mask access_mode); int XaceHookExtAccess(ClientPtr client, ExtensionEntry *ext); int XaceHookServerAccess(ClientPtr client, Mask access_mode); +int XaceHookScreenAccess(ClientPtr client, ScreenPtr screen, Mask access_mode); /* Register a callback for a given hook. diff --git a/dbe/dbe.c b/dbe/dbe.c index cf02bee6d..0353151c6 100644 --- a/dbe/dbe.c +++ b/dbe/dbe.c @@ -611,7 +611,7 @@ ProcDbeGetVisualInfo(ClientPtr client) pDrawables[i]->pScreen; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); - rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); + rc = XaceHookScreenAccess(client, pScreen, DixGetAttrAccess); if (rc != Success) goto freeScrVisInfo; diff --git a/dix/dispatch.c b/dix/dispatch.c index 3a39579ca..8a8761321 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -2517,7 +2517,7 @@ ProcInstallColormap(ClientPtr client) if (rc != Success) goto out; - rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); + rc = XaceHookScreenAccess(client, pcmp->pScreen, DixSetAttrAccess); if (rc != Success) { if (rc == BadValue) rc = BadColor; @@ -2546,7 +2546,7 @@ ProcUninstallColormap(ClientPtr client) if (rc != Success) goto out; - rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); + rc = XaceHookScreenAccess(client, pcmp->pScreen, DixSetAttrAccess); if (rc != Success) { if (rc == BadValue) rc = BadColor; @@ -2576,8 +2576,7 @@ ProcListInstalledColormaps(ClientPtr client) if (rc != Success) return rc; - rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, - DixGetAttrAccess); + rc = XaceHookScreenAccess(client, pWin->drawable.pScreen, DixGetAttrAccess); if (rc != Success) return rc; @@ -3141,7 +3140,7 @@ ProcQueryBestSize(ClientPtr client) if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) return BadMatch; pScreen = pDraw->pScreen; - rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); + rc = XaceHookScreenAccess(client, pScreen, DixGetAttrAccess); if (rc != Success) return rc; (*pScreen->QueryBestSize) (stuff->class, &stuff->width, diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 012da8a56..277b6de5d 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -878,8 +878,7 @@ ProcXFixesHideCursor(ClientPtr client) * This is the first time this client has hid the cursor * for this screen. */ - ret = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, - DixHideAccess); + ret = XaceHookScreenAccess(client, pWin->drawable.pScreen, DixHideAccess); if (ret != Success) return ret; @@ -936,8 +935,7 @@ ProcXFixesShowCursor(ClientPtr client) return BadMatch; } - rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, - DixShowAccess); + rc = XaceHookScreenAccess(client, pWin->drawable.pScreen, DixShowAccess); if (rc != Success) return rc;