From c61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 12:18:53 +0200 Subject: Move each screen's root-window pointer into ScreenRec. Backported from X.org: commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a Author: Jamey Sharp Date: Sat May 22 00:26:28 2010 -0700 Move each screen's root-window pointer into ScreenRec. Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp Reviewed-by: Tiago Vignatti Tested-by: Tiago Vignatti (i686 GNU/Linux) Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXresource.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 39a1992de..226d20f34 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -699,8 +699,8 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) } if(clients[cid] && (id == clients[cid]->lastDrawableID)) { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; + clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; + clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; } } if (!gotOne) @@ -740,8 +740,8 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) } if(clients[cid] && (id == clients[cid]->lastDrawableID)) { - clients[cid]->lastDrawable = (DrawablePtr)WindowTable[0]; - clients[cid]->lastDrawableID = WindowTable[0]->drawable.id; + clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; + clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; } } } -- cgit v1.2.3 From 8c7d7bed969e556aa038aa2d45c7c9697dda9de9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 16:51:59 +0200 Subject: hw/nxagent/NXresource.c: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Required code de-duplication in nxagent. (Will be fixed by ArcticaProject/nx-libs#120 later on). --- nx-X11/programs/Xserver/hw/nxagent/NXresource.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXresource.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c index 226d20f34..96bbde00c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXresource.c @@ -685,8 +685,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) #ifdef NXAGENT_SERVER nxagentResChangedFlag = 1; #endif - if (rtype & RC_CACHED) - FlushClientCaches(res->id); if (rtype != skipDeleteFuncType) (*DeleteFuncs[rtype & TypeMask])(res->value, res->id); xfree(res); @@ -697,11 +695,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) else prev = &res->next; } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; - clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; - } } if (!gotOne) ErrorF("Freeing resource id=%lX which isn't there.\n", @@ -728,8 +721,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) #ifdef NXAGENT_SERVER nxagentResChangedFlag = 1; #endif - if (type & RC_CACHED) - FlushClientCaches(res->id); if (!skipFree) (*DeleteFuncs[type & TypeMask])(res->value, res->id); xfree(res); @@ -738,11 +729,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) else prev = &res->next; } - if(clients[cid] && (id == clients[cid]->lastDrawableID)) - { - clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root; - clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id; - } } } @@ -765,8 +751,6 @@ ChangeResourceValue (XID id, RESTYPE rtype, void * value) for (; res; res = res->next) if ((res->id == id) && (res->type == rtype)) { - if (rtype & RC_CACHED) - FlushClientCaches(res->id); res->value = value; return TRUE; } @@ -1027,8 +1011,6 @@ FreeClientNeverRetainResources(ClientPtr client) if (rtype & RC_NEVERRETAIN) { *prev = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); xfree(this); } @@ -1073,8 +1055,6 @@ FreeClientResources(ClientPtr client) { RESTYPE rtype = this->type; *head = this->next; - if (rtype & RC_CACHED) - FlushClientCaches(this->id); (*DeleteFuncs[rtype & TypeMask])(this->value, this->id); xfree(this); } -- cgit v1.2.3