xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Fri Apr 18 15:57:51 PDT 2008


 Xext/Makefile.am                    |    7 
 Xext/appgroup.c                     |  775 ------------------------------------
 Xext/appgroup.h                     |   67 ---
 Xext/security.c                     |    8 
 dix/dispatch.c                      |    9 
 dix/window.c                        |   67 ---
 hw/dmx/dmxextension.c               |    1 
 hw/xfree86/dixmods/extmod/modinit.h |    8 
 hw/xfree86/loader/dixsym.c          |    3 
 include/dix-config.h.in             |    3 
 include/dixstruct.h                 |    4 
 include/globals.h                   |    4 
 mi/miinitext.c                      |   19 
 os/connection.c                     |    3 
 os/utils.c                          |    3 
 15 files changed, 1 insertion(+), 980 deletions(-)

New commits:
commit eafaf40fb3368ca7e4cf48336fdb7a6c9f536bfa
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Apr 18 18:50:05 2008 -0400

    Death to APPGROUP.

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 4a2925f..ef2e335 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -105,12 +105,6 @@ if XPRINT
 BUILTIN_SRCS += $(XPRINT_SRCS)
 endif
 
-# AppGroup
-APPGROUP_SRCS = appgroup.c appgroup.h
-if APPGROUP
-BUILTIN_SRCS += $(APPGROUP_SRCS)
-endif
-
 # Colormap Utilization Protocol: Less flashing when switching between
 # PsuedoColor apps and better sharing of limited colormap slots
 CUP_SRCS = cup.c
@@ -164,7 +158,6 @@ EXTRA_DIST = \
 	$(XINERAMA_SRCS) \
 	$(XEVIE_SRCS) \
 	$(XPRINT_SRCS) \
-	$(APPGROUP_SRCS) \
 	$(CUP_SRCS) \
 	$(MULTIBUFFER_SRCS) \
 	$(EXTRA_MULTIBUFFER_SRCS) \
diff --git a/Xext/appgroup.c b/Xext/appgroup.c
deleted file mode 100644
index c40782d..0000000
--- a/Xext/appgroup.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/*
-Copyright 1996, 1998, 2001  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-*/
-
-#define NEED_REPLIES
-#define NEED_EVENTS
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "colormapst.h"
-#include "servermd.h"
-#define _XAG_SERVER_
-#include <X11/extensions/Xagstr.h>
-#include "xacestr.h"
-#include "securitysrv.h"
-#include <X11/Xfuncproto.h>
-
-#define XSERV_t
-#include <X11/Xtrans/Xtrans.h>
-#include "../os/osdep.h"
-
-#include <stdio.h>
-
-#include "modinit.h"
-#include "appgroup.h"
-
-typedef struct _AppGroupRec {
-    struct _AppGroupRec* next;
-    XID			appgroupId;
-    ClientPtr*		clients;
-    int			nclients;
-    ClientPtr		leader;
-    Bool		single_screen;
-    Window		default_root;
-    VisualID		root_visual;
-    Colormap		default_colormap;    
-    Pixel		black_pixel;
-    Pixel		white_pixel;
-    xConnSetupPrefix	connSetupPrefix;
-    char*		ConnectionInfo;
-} AppGroupRec, *AppGroupPtr;
-
-static int		ProcXagDispatch(ClientPtr client);
-static int              SProcXagDispatch(ClientPtr client);
-static void		XagResetProc(ExtensionEntry* extEntry);
-
-static int		XagCallbackRefCount = 0;
-
-static RESTYPE		RT_APPGROUP;
-static AppGroupPtr	appGrpList = NULL;
-
-extern xConnSetupPrefix connSetupPrefix;
-extern char* ConnectionInfo;
-extern int connBlockScreenStart;
-
-static 
-int XagAppGroupFree(
-    pointer what,
-    XID id) /* unused */
-{
-    int i;
-    AppGroupPtr pAppGrp = (AppGroupPtr) what;
-
-    if (pAppGrp->leader)
-	for (i = 0; i < pAppGrp->nclients; i++) {
-	    if (pAppGrp->clients[i] == NULL) continue;
-	    CloseDownClient (pAppGrp->clients[i]);
-	}
-
-    if (pAppGrp == appGrpList)
-	appGrpList = appGrpList->next;
-    else {
-	AppGroupPtr tpAppGrp;
-	for (tpAppGrp = appGrpList; 
-	    tpAppGrp->next != NULL; 
-	    tpAppGrp = tpAppGrp->next) {
-	    if (tpAppGrp->next == pAppGrp) {
-		tpAppGrp->next = tpAppGrp->next->next;
-		break;
-	    }
-	}
-    }
-    (void) xfree (pAppGrp->clients);
-    (void) xfree (pAppGrp->ConnectionInfo);
-    (void) xfree (what);
-    return Success;
-}
-
-static void XagClientStateChange(
-    CallbackListPtr* pcbl,
-    pointer nulldata,
-    pointer calldata)
-{
-    NewClientInfoRec* pci = (NewClientInfoRec*) calldata;
-    ClientPtr pClient = pci->client;
-    AppGroupPtr pAppGrp = pClient->appgroup;
-    int slot;
-
-    if (!pAppGrp)
-	return;
-
-    switch (pClient->clientState) {
-    case ClientStateAuthenticating:
-    case ClientStateRunning: 
-    case ClientStateCheckingSecurity:
-	break;
-
-    case ClientStateInitial: 
-    case ClientStateCheckedSecurity:
-	slot = -1;
-	/* see the comment above about Initial vs. CheckedSecurity */
-	if (pAppGrp->nclients != 0) {
-	    /* if this client already in AppGroup, don't add it again */
-	    int i;
-	    for (i = 0; i < pAppGrp->nclients; i++)
-		if (pClient == pAppGrp->clients[i]) return;
-		if (slot == -1 && pAppGrp->clients[i] == NULL)
-			slot = i;
-	}
-	if (slot == -1) {
-	    slot = pAppGrp->nclients++;
-	    pAppGrp->clients = (ClientPtr*) xrealloc (pAppGrp->clients, 
-				pAppGrp->nclients * sizeof (ClientPtr));
-	}
-	pAppGrp->clients[slot] = pClient;
-	pClient->appgroup = pAppGrp;
-	break;
-
-    case ClientStateGone:
-    case ClientStateRetained: /* client disconnected, dump it */
-	{
-	    int i;
-	    for (i = 0; i < pAppGrp->nclients; i++)
-		if (pAppGrp->clients[i] == pClient) {
-		    pAppGrp->clients[i] = NULL;
-		    break;
-		}
-	}
-	pClient->appgroup = NULL; /* redundant, pClient will be freed */
-	break;
-    }
-}
-
-/*ARGSUSED*/
-static 
-void XagResetProc(
-    ExtensionEntry* extEntry)
-{
-    DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
-    XagCallbackRefCount = 0;
-    while (appGrpList) XagAppGroupFree ((pointer) appGrpList, 0);
-}
-
-static 
-int ProcXagQueryVersion(
-    register ClientPtr client)
-{
-    /* REQUEST (xXagQueryVersionReq); */
-    xXagQueryVersionReply rep;
-    register int n;
-
-    REQUEST_SIZE_MATCH (xXagQueryVersionReq);
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequence_number = client->sequence;
-    rep.server_major_version = XAG_MAJOR_VERSION;
-    rep.server_minor_version = XAG_MINOR_VERSION;
-    if (client->swapped) {
-    	swaps (&rep.sequence_number, n);
-    	swapl (&rep.length, n);
-    	swaps (&rep.server_major_version, n);
-    	swaps (&rep.server_minor_version, n);
-    }
-    WriteToClient (client, sizeof (xXagQueryVersionReply), (char *)&rep);
-    return client->noClientException;
-}
-
-static 
-void ProcessAttr(
-    AppGroupPtr pAppGrp,
-    ClientPtr client,
-    unsigned int attrib_mask,
-    CARD32* attribs)
-{
-    int i;
-
-    for (i = 0; i <= XagNappGroupLeader; i++) {
-	switch (attrib_mask & (1 << i)) {
-	case XagSingleScreenMask:
-	    pAppGrp->single_screen = *attribs;
-	    break;
-	case XagDefaultRootMask:
-	    pAppGrp->default_root = *attribs;
-	    break;
-	case XagRootVisualMask:
-	    pAppGrp->root_visual = *attribs;
-	    break;
-	case XagDefaultColormapMask:
-	    pAppGrp->default_colormap = *attribs;
-	    break;
-	case XagBlackPixelMask:
-	    pAppGrp->black_pixel = *attribs;
-	    break;
-	case XagWhitePixelMask:
-	    pAppGrp->white_pixel = *attribs;
-	    break;
-	case XagAppGroupLeaderMask:
-	    pAppGrp->leader = client;
-	    break;
-	default: continue;
-	}
-	attribs++;
-    }
-}
-
-static 
-void CreateConnectionInfo(
-    AppGroupPtr pAppGrp)
-{
-    xWindowRoot* rootp;
-    xWindowRoot* roots[MAXSCREENS];
-    unsigned int rootlens[MAXSCREENS];
-    xDepth* depth;
-    int olen;
-    int snum, i;
-
-    rootp = (xWindowRoot*) (ConnectionInfo + connBlockScreenStart);
-    for (snum = 0; snum < screenInfo.numScreens; snum++) {
-
-	rootlens[snum] = sizeof (xWindowRoot);
-	roots[snum] = rootp;
-
-	depth = (xDepth*) (rootp + 1);
-	for (i = 0; i < rootp->nDepths; i++) {
-	    rootlens[snum] += sizeof (xDepth) + 
-			      depth->nVisuals * sizeof (xVisualType);
-	    depth = (xDepth *)(((char*)(depth + 1)) +
-		depth->nVisuals * sizeof (xVisualType));
-	}
-	rootp = (xWindowRoot*) depth;
-    }
-    snum = 0;
-    if (pAppGrp->default_root) {
-	for (; snum < screenInfo.numVideoScreens; snum++) {
-	    if (roots[snum]->windowId == pAppGrp->default_root)
-		break;
-        }
-    }
-    olen = connBlockScreenStart + rootlens[snum];
-    for (i = screenInfo.numVideoScreens; i < screenInfo.numScreens; i++)
-	olen += rootlens[i];
-    pAppGrp->ConnectionInfo = (char*) xalloc (olen);
-    if (!pAppGrp->ConnectionInfo)
-	return;
-    memmove (pAppGrp->ConnectionInfo, ConnectionInfo, connBlockScreenStart);
-    ((xConnSetup*) (pAppGrp->ConnectionInfo))->numRoots = 
-	1 + screenInfo.numScreens - screenInfo.numVideoScreens;
-    memmove (pAppGrp->ConnectionInfo + connBlockScreenStart,
-	     (void*) roots[snum], rootlens[snum]);
-    rootp = (xWindowRoot*) (pAppGrp->ConnectionInfo + connBlockScreenStart);
-    if (pAppGrp->default_colormap) {
-	rootp->defaultColormap = pAppGrp->default_colormap;
-	rootp->whitePixel = pAppGrp->white_pixel;
-	rootp->blackPixel = pAppGrp->black_pixel;
-    }
-    if (pAppGrp->root_visual)
-	rootp->rootVisualID = pAppGrp->root_visual;
-    rootp = (xWindowRoot*) (((char*)rootp) + rootlens[snum]);
-    for (i = screenInfo.numVideoScreens; i < screenInfo.numScreens; i++) {
-	memmove ((void*) rootp, (void*) roots[i], rootlens[i]);
-	rootp = (xWindowRoot*) (((char*) rootp) + rootlens[i]);
-    }
-    pAppGrp->connSetupPrefix = connSetupPrefix;
-    pAppGrp->connSetupPrefix.length = olen >> 2;
-}
-
-static 
-AppGroupPtr CreateAppGroup(
-    ClientPtr client,
-    XID appgroupId,
-    unsigned int attrib_mask,
-    CARD32* attribs)
-{
-    AppGroupPtr pAppGrp;
-
-    pAppGrp = (AppGroupPtr) xalloc (sizeof(AppGroupRec));
-    if (pAppGrp) {
-	pAppGrp->next = appGrpList;
-	appGrpList = pAppGrp;
-	pAppGrp->appgroupId = appgroupId;
-	pAppGrp->clients = (ClientPtr*) xalloc (0);
-	pAppGrp->nclients = 0;
-	pAppGrp->leader = NULL;
-	pAppGrp->default_root = 0;
-	pAppGrp->root_visual = 0;
-	pAppGrp->default_colormap = 0;
-	pAppGrp->black_pixel = -1;
-	pAppGrp->white_pixel = -1;
-	pAppGrp->ConnectionInfo = NULL;
-	ProcessAttr (pAppGrp, client, attrib_mask, attribs);
-    }
-    return pAppGrp;
-}
-
-static 
-int AttrValidate(
-    ClientPtr client,
-    int attrib_mask,
-    AppGroupPtr pAppGrp)
-{
-    WindowPtr pWin;
-    int idepth, ivids, found, rc;
-    ScreenPtr pScreen;
-    DepthPtr pDepth;
-    ColormapPtr pColormap;
-
-    rc = dixLookupWindow(&pWin, pAppGrp->default_root, client,
-			 DixGetAttrAccess);
-    if (rc != Success)
-	return rc;
-    pScreen = pWin->drawable.pScreen;
-    if (WindowTable[pScreen->myNum]->drawable.id != pAppGrp->default_root)
-	return BadWindow;
-    pDepth = pScreen->allowedDepths;
-    if (pAppGrp->root_visual) {
-	found = FALSE;
-	for (idepth = 0; idepth < pScreen->numDepths; idepth++, pDepth++) {
-	    for (ivids = 0; ivids < pDepth->numVids; ivids++) {
-		if (pAppGrp->root_visual == pDepth->vids[ivids]) {
-		    found = TRUE;
-		    break;
-		}
-	    }
-	}
-	if (!found)
-	    return BadMatch;
-    }
-    if (pAppGrp->default_colormap) {
-
-	rc = dixLookupResource((pointer *)&pColormap, pAppGrp->default_colormap,
-			       RT_COLORMAP, client, DixUseAccess);
-	if (rc != Success)
-	    return rc;
-	if (pColormap->pScreen != pScreen)
-	    return BadColor;
-	if (pColormap->pVisual->vid != (pAppGrp->root_visual ? pAppGrp->root_visual : pScreen->rootVisual))
-	    return BadMatch;
-    }
-    return client->noClientException;
-}
-
-static int ProcXagCreate (
-    register ClientPtr client)
-{
-    REQUEST (xXagCreateReq);
-    AppGroupPtr pAppGrp;
-    int ret;
-
-    REQUEST_AT_LEAST_SIZE (xXagCreateReq);
-
-    LEGAL_NEW_RESOURCE (stuff->app_group, client);
-    pAppGrp = CreateAppGroup (client, stuff->app_group, 
-		stuff->attrib_mask, (CARD32*) &stuff[1]);
-    if (!pAppGrp)
-	return BadAlloc;
-    ret = AttrValidate (client, stuff->attrib_mask, pAppGrp);
-    if (ret != Success) {
-	XagAppGroupFree ((pointer)pAppGrp, (XID)0);
-	return ret;
-    }
-    if (pAppGrp->single_screen) {
-	CreateConnectionInfo (pAppGrp);
-	if (!pAppGrp->ConnectionInfo)
-	    return BadAlloc;
-    }
-    if (!AddResource (stuff->app_group, RT_APPGROUP, (pointer)pAppGrp))
-	return BadAlloc;
-    if (XagCallbackRefCount++ == 0)
-	(void) AddCallback (&ClientStateCallback, XagClientStateChange, NULL);
-    return client->noClientException;
-}
-
-static int ProcXagDestroy(
-    register ClientPtr client)
-{
-    AppGroupPtr pAppGrp;
-    REQUEST (xXagDestroyReq);
-
-    REQUEST_SIZE_MATCH (xXagDestroyReq);
-    pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client, 
-		(XID)stuff->app_group, RT_APPGROUP, DixReadAccess);
-    if (!pAppGrp) return XagBadAppGroup;
-    FreeResource ((XID)stuff->app_group, RT_NONE);
-    if (--XagCallbackRefCount == 0)
-	(void) DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
-    return client->noClientException;
-}
-
-static 
-int ProcXagGetAttr(
-    register ClientPtr client)
-{
-    AppGroupPtr pAppGrp;
-    REQUEST (xXagGetAttrReq);
-    xXagGetAttrReply rep;
-    int n;
-
-    REQUEST_SIZE_MATCH (xXagGetAttrReq);
-    pAppGrp = (AppGroupPtr)SecurityLookupIDByType (client, 
-		(XID)stuff->app_group, RT_APPGROUP, DixReadAccess);
-    if (!pAppGrp) return XagBadAppGroup;
-    rep.type = X_Reply;
-    rep.length = 0;
-    rep.sequence_number = client->sequence;
-    rep.default_root = pAppGrp->default_root;
-    rep.root_visual = pAppGrp->root_visual;
-    rep.default_colormap = pAppGrp->default_colormap;
-    rep.black_pixel = pAppGrp->black_pixel;
-    rep.white_pixel = pAppGrp->white_pixel;
-    rep.single_screen = pAppGrp->single_screen;
-    rep.app_group_leader = (pAppGrp->leader) ? 1 : 0;
-    if (client->swapped) {
-    	swaps (&rep.sequence_number, n);
-    	swapl (&rep.length, n);
-    	swapl (&rep.default_root, n);
-    	swapl (&rep.root_visual, n);
-    	swapl (&rep.default_colormap, n);
-    	swapl (&rep.black_pixel, n);
-    	swapl (&rep.white_pixel, n);
-    }
-    WriteToClient (client, sizeof (xXagGetAttrReply), (char *)&rep);
-    return client->noClientException;
-}
-
-static 
-int ProcXagQuery(
-    register ClientPtr client)
-{
-    ClientPtr pClient;
-    AppGroupPtr pAppGrp;
-    REQUEST (xXagQueryReq);
-    int n, rc;
-
-    REQUEST_SIZE_MATCH (xXagQueryReq);
-    rc = dixLookupClient(&pClient, stuff->resource, client, DixGetAttrAccess);
-    if (rc != Success)
-	return rc;
-
-    for (pAppGrp = appGrpList; pAppGrp != NULL; pAppGrp = pAppGrp->next)
-	for (n = 0; n < pAppGrp->nclients; n++)
-	    if (pAppGrp->clients[n] == pClient) {
-		xXagQueryReply rep;
-
-		rep.type = X_Reply;
-		rep.length = 0;
-		rep.sequence_number = client->sequence;
-		rep.app_group = pAppGrp->appgroupId;
-		if (client->swapped) {
-		    swaps (&rep.sequence_number, n);
-		    swapl (&rep.length, n);
-		    swapl (&rep.app_group, n);
-		}
-		WriteToClient (client, sizeof (xXagQueryReply), (char *)&rep);
-		return client->noClientException;
-	    }
-
-    return BadMatch;
-}
-
-static 
-int ProcXagCreateAssoc(
-    register ClientPtr client)
-{
-    REQUEST (xXagCreateAssocReq);
-
-    REQUEST_SIZE_MATCH (xXagCreateAssocReq);
-#ifdef WIN32
-    if (stuff->window_type != XagWindowTypeWin32)
-#else
-    if (stuff->window_type != XagWindowTypeX11)
-#endif
-	return BadMatch;
-#if defined(WIN32) || defined(__CYGWIN__) /* and Mac, etc */
-    if (!LocalClient (client))
-	return BadAccess;
-#endif
-
-/* Macintosh, OS/2, and MS-Windows servers have some work to do here */
-
-    return client->noClientException;
-}
-
-static 
-int ProcXagDestroyAssoc(
-    register ClientPtr client)
-{
-    /* REQUEST (xXagDestroyAssocReq); */
-
-    REQUEST_SIZE_MATCH (xXagDestroyAssocReq);
-/* Macintosh, OS/2, and MS-Windows servers have some work to do here */
-    return client->noClientException;
-}
-
-static 
-int ProcXagDispatch (
-    register ClientPtr client)
-{
-    REQUEST (xReq);
-    switch (stuff->data)
-    {
-    case X_XagQueryVersion:
-	return ProcXagQueryVersion (client);
-    case X_XagCreate:
-	return ProcXagCreate (client);
-    case X_XagDestroy:
-	return ProcXagDestroy (client);
-    case X_XagGetAttr:
-	return ProcXagGetAttr (client);
-    case X_XagQuery:
-	return ProcXagQuery (client);
-    case X_XagCreateAssoc:
-	return ProcXagCreateAssoc (client);
-    case X_XagDestroyAssoc:
-	return ProcXagDestroyAssoc (client);
-    default:
-	return BadRequest;
-    }
-}
-
-static 
-int SProcXagQueryVersion(
-    register ClientPtr client)
-{
-    register int n;
-    REQUEST(xXagQueryVersionReq);
-    swaps(&stuff->length, n);
-    return ProcXagQueryVersion(client);
-}
-
-static 
-int SProcXagCreate(
-    ClientPtr client)
-{
-    register int n;
-    REQUEST (xXagCreateReq);
-    swaps (&stuff->length, n);
-    REQUEST_AT_LEAST_SIZE (xXagCreateReq);
-    swapl (&stuff->app_group, n);
-    swapl (&stuff->attrib_mask, n);
-    SwapRestL (stuff);
-    return ProcXagCreate (client);
-}
-
-static 
-int SProcXagDestroy(
-    ClientPtr client)
-{
-    register int n;
-    REQUEST (xXagDestroyReq);
-    swaps (&stuff->length, n);
-    REQUEST_SIZE_MATCH (xXagDestroyReq);
-    swapl (&stuff->app_group, n);
-    return ProcXagDestroy (client);
-}
-
-static 
-int SProcXagGetAttr(
-    ClientPtr client)
-{
-    register int n;
-    REQUEST (xXagGetAttrReq);
-    swaps (&stuff->length, n);
-    REQUEST_SIZE_MATCH (xXagGetAttrReq);
-    swapl (&stuff->app_group, n);
-    return ProcXagGetAttr (client);
-}
-
-static 
-int SProcXagQuery(
-    ClientPtr client)
-{
-    register int n;
-    REQUEST (xXagQueryReq);
-    swaps (&stuff->length, n);
-    REQUEST_SIZE_MATCH (xXagQueryReq);
-    swapl (&stuff->resource, n);
-    return ProcXagQuery (client);
-}
-
-static 
-int SProcXagCreateAssoc(
-    ClientPtr client)
-{
-    register int n;
-    REQUEST (xXagCreateAssocReq);
-    swaps (&stuff->length, n);
-    REQUEST_SIZE_MATCH (xXagCreateAssocReq);
-    swapl (&stuff->window, n);
-    swapl (&stuff->window_type, n);
-    swaps (&stuff->system_window_len, n);
-    return ProcXagCreateAssoc (client);
-}
-
-static 
-int SProcXagDestroyAssoc(
-    ClientPtr client)
-{
-    register int n;
-    REQUEST (xXagDestroyAssocReq);
-    swaps (&stuff->length, n);
-    REQUEST_SIZE_MATCH (xXagDestroyAssocReq);
-    swapl (&stuff->window, n);
-    return ProcXagDestroyAssoc (client);
-}
-
-static 
-int SProcXagDispatch(
-    register ClientPtr client)
-{
-    REQUEST(xReq);
-    switch (stuff->data)
-    {
-    case X_XagQueryVersion:
-	return SProcXagQueryVersion (client);
-    case X_XagCreate:
-	return SProcXagCreate (client);
-    case X_XagDestroy:
-	return SProcXagDestroy (client);
-    case X_XagGetAttr:
-	return SProcXagGetAttr (client);
-    case X_XagQuery:
-	return SProcXagQuery (client);
-    case X_XagCreateAssoc:
-	return SProcXagCreateAssoc (client);
-    case X_XagDestroyAssoc:
-	return SProcXagDestroyAssoc (client);
-    default:
-	return BadRequest;
-    }
-}
-
-Colormap XagDefaultColormap(
-    ClientPtr client)
-{
-    return (client->appgroup ? client->appgroup->default_colormap : None);
-}
-
-VisualID XagRootVisual(
-    ClientPtr client)
-{
-    return (client->appgroup ? client->appgroup->root_visual : 0);
-}
-
-ClientPtr XagLeader(
-    ClientPtr client)
-{
-    return (client->appgroup ? client->appgroup->leader : NULL);
-}
-
-/*
- * Return whether the Map request event should be sent to the appgroup leader.
- * We don't want to send it to the leader when the window is on a different
- * screen, e.g. a print screen.
- */
-Bool XagIsControlledRoot(
-    ClientPtr client,
-    WindowPtr pParent)
-{
-    if (client->appgroup) {
-	if (client->appgroup->single_screen && 
-	    pParent->drawable.id == client->appgroup->default_root)
-	    return TRUE;
-	else if (!pParent->parent)
-	    return TRUE;
-	else
-	    return FALSE;
-    }
-    return FALSE; 
-}
-
-void XagConnectionInfo(
-    ClientPtr client,
-    xConnSetupPrefix** conn_prefix,
-    char** conn_info,
-    int* num_screen)
-{
-    if (client->appgroup && client->appgroup->ConnectionInfo) {
-	*conn_prefix = &client->appgroup->connSetupPrefix;
-	*conn_info = client->appgroup->ConnectionInfo;
-	*num_screen = ((xConnSetup*)(client->appgroup->ConnectionInfo))->numRoots;
-    } 
-}
-
-XID XagId(
-    ClientPtr client)
-{
-    return (client->appgroup ? client->appgroup->appgroupId : 0);
-}
-
-static void XagCallClientStateChange(
-    CallbackListPtr *pcbl,
-    pointer nulldata,
-    pointer calldata)
-{
-    XaceAuthAvailRec* rec = (XaceAuthAvailRec*) calldata;
-    ClientPtr pClient = rec->client;
-
-    if (!pClient->appgroup) {
-	SecurityAuthorizationPtr pAuth;
-	XID authId = rec->authId;
-
-	/* can't use SecurityLookupIDByType here -- client
-	 * security state hasn't been setup yet.
-	 */
-	pAuth = (SecurityAuthorizationPtr)LookupIDByType(authId,
-				SecurityAuthorizationResType);
-	if (!pAuth)
-	    return;
-
-	pClient->appgroup = (AppGroupPtr)LookupIDByType(pAuth->group,
-							RT_APPGROUP);
-    }
-
-    if (pClient->appgroup) {
-	NewClientInfoRec clientinfo;
-
-	clientinfo.client = pClient;
-	XagClientStateChange (NULL, NULL, (pointer)&clientinfo);
-    }
-}
-
-void
-XagExtensionInit(INITARGS)
-{
-    if (AddExtension (XAGNAME,
-		      0,
-		      XagNumberErrors,
-		      ProcXagDispatch,
-		      SProcXagDispatch,
-		      XagResetProc,
-		      StandardMinorOpcode)) {
-	RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
-	XaceRegisterCallback(XACE_AUTH_AVAIL, XagCallClientStateChange, NULL);
-    }
-}
diff --git a/Xext/appgroup.h b/Xext/appgroup.h
deleted file mode 100644
index 778da5d..0000000
--- a/Xext/appgroup.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-Copyright 1996, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-*/
-
-#ifndef _APPGROUP_SRV_H_
-#define _APPGROUP_SRV_H_
-
-#include <X11/Xfuncproto.h>
-
-_XFUNCPROTOBEGIN
-
-extern void XagConnectionInfo(
-    ClientPtr			/* client */,
-    xConnSetupPrefix**		/* conn_prefix */,
-    char**			/* conn_info */,
-    int*			/* num_screens */
-);
-
-extern VisualID XagRootVisual(
-    ClientPtr			/* client */
-);
-
-extern Colormap XagDefaultColormap(
-    ClientPtr			/* client */
-);
-
-extern ClientPtr XagLeader(
-    ClientPtr			/* client */
-);
-
-extern Bool XagIsControlledRoot (
-    ClientPtr			/* client */,
-    WindowPtr			/* pParent */
-);
-
-extern XID XagId (
-    ClientPtr			/* client */
-);
-
-_XFUNCPROTOEND
-
-#endif /* _APPGROUP_SRV_H_ */
-
-
-
diff --git a/Xext/security.c b/Xext/security.c
index e82b976..b599030 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -38,9 +38,6 @@ in this Software without prior written authorization from The Open Group.
 #include "xacestr.h"
 #include "securitysrv.h"
 #include <X11/extensions/securstr.h>
-#ifdef XAPPGROUP
-#include "appgroup.h"
-#endif
 #include "modinit.h"
 
 /* Extension stuff */
@@ -833,11 +830,6 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
 	return;
 
-#ifdef XAPPGROUP
-    if (rec->id == XagDefaultColormap(rec->client))
-	return;
-#endif
-
     SecurityAudit("Security: denied client %d access %x to resource 0x%x "
 		  "of client %d on request %s\n", rec->client->index,
 		  requested, rec->id, cid,
diff --git a/dix/dispatch.c b/dix/dispatch.c
index bb8b0c4..5025953 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -136,9 +136,6 @@ int ProcInitialConnection();
 #endif
 #include "privates.h"
 #include "xace.h"
-#ifdef XAPPGROUP
-#include "appgroup.h"
-#endif
 #ifdef XKB
 #ifndef XKB_IN_SERVER
 #define XKB_IN_SERVER
@@ -3516,9 +3513,6 @@ void InitClient(ClientPtr client, int i, pointer ospriv)
     }
 #endif
     client->replyBytesRemaining = 0;
-#ifdef XAPPGROUP
-    client->appgroup = NULL;
-#endif
     client->fontResFunc = NULL;
 #ifdef SMART_SCHEDULE
     client->smart_priority = 0;
@@ -3643,9 +3637,6 @@ SendConnSetup(ClientPtr client, char *reason)
 
     client->requestVector = client->swapped ? SwappedProcVector : ProcVector;
     client->sequence = 0;
-#ifdef XAPPGROUP
-    XagConnectionInfo (client, &lconnSetupPrefix, &lConnectionInfo, &numScreens);
-#endif
     ((xConnSetup *)lConnectionInfo)->ridBase = client->clientAsMask;
     ((xConnSetup *)lConnectionInfo)->ridMask = RESOURCE_ID_MASK;
 #ifdef MATCH_CLIENT_ENDIAN
diff --git a/dix/window.c b/dix/window.c
index 499f58e..168e940 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -123,9 +123,6 @@ Equipment Corporation.
 #include "dixevents.h"
 #include "globals.h"
 
-#ifdef XAPPGROUP
-#include "appgroup.h"
-#endif
 #include "privates.h"
 #include "xace.h"
 
@@ -603,14 +600,6 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
     if (!ancwopt)
 	ancwopt = FindWindowWithOptional(pParent)->optional;
     if (visual == CopyFromParent) {
-#ifdef XAPPGROUP
-	VisualID ag_visual;
-
-	if (client->appgroup && !pParent->parent &&
-	    (ag_visual = XagRootVisual (client)))
-	    visual = ag_visual;
-	else
-#endif
 	visual = ancwopt->visual;
     }
 
@@ -1290,22 +1279,6 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
 	    pVlist++;
 	    if (cmap == CopyFromParent)
 	    {
-#ifdef XAPPGROUP
-		Colormap ag_colormap;
-		ClientPtr win_owner;
-
-		/*
-		 * win_owner == client for CreateWindow, other clients
-		 * can ChangeWindowAttributes
-		 */
-		win_owner = clients[CLIENT_ID(pWin->drawable.id)];
-
-		if ( win_owner && win_owner->appgroup &&
-		    !pWin->parent->parent &&
-		    (ag_colormap = XagDefaultColormap (win_owner)))
-		    cmap = ag_colormap;
-		else
-#endif
 		if (pWin->parent &&
 		    (!pWin->optional ||
 		     pWin->optional->visual == wVisual (pWin->parent)))
@@ -2234,10 +2207,6 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 		   h = pWin->drawable.height,
 		   bw = pWin->borderWidth;
     int rc, action, smode = Above;
-#ifdef XAPPGROUP
-    ClientPtr win_owner;
-    ClientPtr ag_leader = NULL;
-#endif
     xEvent event;
 
     if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask))
@@ -2333,17 +2302,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
     else
 	pSib = pWin->nextSib;
 
-#ifdef XAPPGROUP
-    win_owner = clients[CLIENT_ID(pWin->drawable.id)];
-    ag_leader = XagLeader (win_owner);
-#endif
 
     if ((!pWin->overrideRedirect) && 
 	(RedirectSend(pParent)
-#ifdef XAPPGROUP
-	|| (win_owner->appgroup && ag_leader && 
-	    XagIsControlledRoot (client, pParent))
-#endif
 	))
     {
 	event.u.u.type = ConfigureRequest;
@@ -2368,16 +2329,6 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
 	event.u.configureRequest.height = h;
 	event.u.configureRequest.borderWidth = bw;
 	event.u.configureRequest.valueMask = mask;
-#ifdef XAPPGROUP
-	/* make sure if the ag_leader maps the window it goes to the wm */
-	if (ag_leader && ag_leader != client && 
-	    XagIsControlledRoot (client, pParent)) {
-	    event.u.configureRequest.parent = XagId (win_owner);
-	    (void) TryClientEvents (ag_leader, &event, 1,
-				    NoEventMask, NoEventMask, NullGrab);
-	    return Success;
-	}
-#endif
 	event.u.configureRequest.parent = pParent->drawable.id;
 	if (MaybeDeliverEventsToClient(pParent, &event, 1,
 		SubstructureRedirectMask, client) == 1)
@@ -2754,31 +2705,13 @@ MapWindow(WindowPtr pWin, ClientPtr client)
     {
 	xEvent event;
 	Bool anyMarked;
-#ifdef XAPPGROUP
-	ClientPtr win_owner = clients[CLIENT_ID(pWin->drawable.id)];
-	ClientPtr ag_leader = XagLeader (win_owner);
-#endif
 
 	if ((!pWin->overrideRedirect) && 
 	    (RedirectSend(pParent)
-#ifdef XAPPGROUP
-	    || (win_owner->appgroup && ag_leader &&
-		XagIsControlledRoot (client, pParent))
-#endif
 	))
 	{
 	    event.u.u.type = MapRequest;
 	    event.u.mapRequest.window = pWin->drawable.id;
-#ifdef XAPPGROUP
-	    /* make sure if the ag_leader maps the window it goes to the wm */
-	    if (ag_leader && ag_leader != client &&
-		XagIsControlledRoot (client, pParent)) {
-		event.u.mapRequest.parent = XagId (win_owner);
-		(void) TryClientEvents (ag_leader, &event, 1,
-					NoEventMask, NoEventMask, NullGrab);
-		return Success;
-	    }
-#endif
 	    event.u.mapRequest.parent = pParent->drawable.id;
 
 	    if (MaybeDeliverEventsToClient(pParent, &event, 1,
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index 560468c..aaa50d5 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -1350,7 +1350,6 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
  * RTContext
  * TagResType
  * StalledResType
- * RT_APPGROUP
  * SecurityAuthorizationResType
  * RTEventClient
  * __glXContextRes
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index bfbf443..3224850 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -129,14 +129,6 @@ extern void SecurityExtensionInit(INITARGS);
 #endif
 
 #if 1
-extern void XagExtensionInit(INITARGS);
-#endif
-
-#if 1
-extern void XpExtensionInit(INITARGS);
-#endif
-
-#if 1
 extern void PanoramiXExtensionInit(int argc, char *argv[]);
 #endif
 
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index a95dbe9..8093a79 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -397,9 +397,6 @@ _X_HIDDEN void *dixLookupTab[] = {
 #ifdef RES
     SYMVAR(noResExtension)
 #endif
-#ifdef XAPPGROUP
-    SYMVAR(noXagExtension)
-#endif
 #ifdef XCMISC
     SYMVAR(noXCMiscExtension)
 #endif
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 4556223..53d1046 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -416,9 +416,6 @@
 /* Support Xv extension */
 #undef XV
 
-/* Build APPGROUP extension */
-#undef XAPPGROUP
-
 /* Build TOG-CUP extension */
 #undef TOGCUP
 
diff --git a/include/dixstruct.h b/include/dixstruct.h
index d44b9cf..18d161a 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -125,9 +125,7 @@ typedef struct _Client {
     int         requestLogIndex;
 #endif
     unsigned long replyBytesRemaining;
-#ifdef XAPPGROUP
-    struct _AppGroupRec*	appgroup;
-#endif
+    void *appgroup; /* Can't remove, ABI */
     struct _FontResolution * (*fontResFunc) (    /* no need for font.h */
 		ClientPtr	/* pClient */,
 		int *		/* num */);
diff --git a/include/globals.h b/include/globals.h
index 1cedc0d..cfb6c2c 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -118,10 +118,6 @@ extern Bool noXcupExtension;
 extern Bool noResExtension;
 #endif
 
-#ifdef XAPPGROUP
-extern Bool noXagExtension;
-#endif
-
 #ifdef XCMISC
 extern Bool noXCMiscExtension;
 #endif
diff --git a/mi/miinitext.c b/mi/miinitext.c
index 568bc9e..74ec282 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -169,9 +169,6 @@ extern Bool noXcupExtension;
 #ifdef RES
 extern Bool noResExtension;
 #endif
-#ifdef XAPPGROUP
-extern Bool noXagExtension;
-#endif
 #ifdef XCMISC
 extern Bool noXCMiscExtension;
 #endif
@@ -240,10 +237,6 @@ typedef void (*InitExtension)(INITARGS);
 #ifdef XPRINT
 #include <X11/extensions/Print.h>
 #endif
-#ifdef XAPPGROUP
-#define _XAG_SERVER_
-#include <X11/extensions/Xagstr.h>
-#endif
 #ifdef XCSECURITY
 #include "securitysrv.h"
 #include <X11/extensions/securstr.h>
@@ -314,9 +307,6 @@ extern void RecordExtensionInit(INITARGS);
 #ifdef DBE
 extern void DbeExtensionInit(INITARGS);
 #endif
-#ifdef XAPPGROUP
-extern void XagExtensionInit(INITARGS);
-#endif
 #ifdef XCSECURITY
 extern void SecurityExtensionInit(INITARGS);
 #endif
@@ -446,9 +436,6 @@ static ExtensionToggle ExtensionToggleList[] =
 #ifdef RES
     { "X-Resource", &noResExtension },
 #endif
-#ifdef XAPPGROUP
-    { "XC-APPGROUP", &noXagExtension },
-#endif
 #ifdef XCMISC
     { "XC-MISC", &noXCMiscExtension },
 #endif
@@ -584,9 +571,6 @@ InitExtensions(argc, argv)
 #ifdef DBE
     if (!noDbeExtension) DbeExtensionInit();
 #endif
-#ifdef XAPPGROUP
-    if (!noXagExtension) XagExtensionInit();
-#endif
 #ifdef XCSECURITY
     if (!noSecurityExtension) SecurityExtensionInit();
 #endif
@@ -678,9 +662,6 @@ static ExtensionModule staticExtensions[] = {
 #ifdef XKB
     { XkbExtensionInit, XkbName, &noXkbExtension, NULL, NULL },
 #endif
-#ifdef XAPPGROUP
-    { XagExtensionInit, XAGNAME, &noXagExtension, NULL, NULL },
-#endif
 #ifdef XCSECURITY
     { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },
 #endif
diff --git a/os/connection.c b/os/connection.c
index 1ae50fe..3965936 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -139,9 +139,6 @@ SOFTWARE.
 #include <X11/Xpoll.h>
 #include "opaque.h"
 #include "dixstruct.h"
-#ifdef XAPPGROUP
-#include "appgroup.h"
-#endif
 #include "xace.h"
 
 #ifdef X_NOT_POSIX
diff --git a/os/utils.c b/os/utils.c
index 5486010..4210e5d 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -189,9 +189,6 @@ _X_EXPORT Bool noXcupExtension = FALSE;
 #ifdef RES
 _X_EXPORT Bool noResExtension = FALSE;
 #endif
-#ifdef XAPPGROUP
-_X_EXPORT Bool noXagExtension = FALSE;
-#endif
 #ifdef XCMISC
 _X_EXPORT Bool noXCMiscExtension = FALSE;
 #endif


More information about the xorg-commit mailing list