diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-02-24 12:23:51 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-02-24 12:23:51 +0100 |
commit | 31426a3d27ffccacfcd8b0130b65b39a8c9a5522 (patch) | |
tree | d24fcf630f3e50c8c12fe3bbfe7b16e4ced02f6e /nx-X11/programs/Xserver/dix/dixutils.c | |
parent | 3c322ffbb911b70415c47cb8ba1c3559241819f6 (diff) | |
parent | 3d8575c2114ed98e525c422bba88e04f0af7f029 (diff) | |
download | nx-libs-31426a3d27ffccacfcd8b0130b65b39a8c9a5522.tar.gz nx-libs-31426a3d27ffccacfcd8b0130b65b39a8c9a5522.tar.bz2 nx-libs-31426a3d27ffccacfcd8b0130b65b39a8c9a5522.zip |
Merge branch 'uli42-fix_#306_#322' into 3.6.x
Attributes GH PR #338: https://github.com/ArcticaProject/nx-libs/pull/338
Diffstat (limited to 'nx-X11/programs/Xserver/dix/dixutils.c')
-rw-r--r-- | nx-X11/programs/Xserver/dix/dixutils.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index bf925f748..3ccc90d71 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -210,27 +210,10 @@ CompareISOLatin1Lowered(unsigned char *s1, int s1len, WindowPtr SecurityLookupWindow(XID rid, ClientPtr client, Mask access_mode) { - WindowPtr pWin; - client->errorValue = rid; if(rid == INVALID) return NULL; - if (client->trustLevel != XSecurityClientTrusted) - return (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); - if (client->lastDrawableID == rid) - { - if (client->lastDrawable->type == DRAWABLE_WINDOW) - return ((WindowPtr) client->lastDrawable); - return (WindowPtr) NULL; - } - pWin = (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); - if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) { - client->lastDrawable = (DrawablePtr) pWin; - client->lastDrawableID = rid; - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - return pWin; + return (WindowPtr)SecurityLookupIDByType(client, rid, RT_WINDOW, access_mode); } @@ -241,15 +224,10 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) if(rid == INVALID) return (void *) NULL; - if (client->trustLevel != XSecurityClientTrusted) - return (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, - access_mode); - if (client->lastDrawableID == rid) - return ((void *) client->lastDrawable); pDraw = (DrawablePtr)SecurityLookupIDByClass(client, rid, RC_DRAWABLE, access_mode); - if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) - return (void *)pDraw; + if ((client->trustLevel != XSecurityClientTrusted) || (pDraw && (pDraw->type != UNDRAWABLE_WINDOW))) + return (void *)pDraw; return (void *)NULL; } @@ -279,20 +257,7 @@ LookupWindow(XID rid, ClientPtr client) client->errorValue = rid; if(rid == INVALID) return NULL; - if (client->lastDrawableID == rid) - { - if (client->lastDrawable->type == DRAWABLE_WINDOW) - return ((WindowPtr) client->lastDrawable); - return (WindowPtr) NULL; - } - pWin = (WindowPtr)LookupIDByType(rid, RT_WINDOW); - if (pWin && pWin->drawable.type == DRAWABLE_WINDOW) { - client->lastDrawable = (DrawablePtr) pWin; - client->lastDrawableID = rid; - client->lastGCID = INVALID; - client->lastGC = (GCPtr)NULL; - } - return pWin; + return (WindowPtr)LookupIDByType(rid, RT_WINDOW); } @@ -303,8 +268,6 @@ LookupDrawable(XID rid, ClientPtr client) if(rid == INVALID) return (void *) NULL; - if (client->lastDrawableID == rid) - return ((void *) client->lastDrawable); pDraw = (DrawablePtr)LookupIDByClass(rid, RC_DRAWABLE); if (pDraw && (pDraw->type != UNDRAWABLE_WINDOW)) return (void *)pDraw; |