diff options
authorKeith Packard <>2010-06-05 21:24:54 -0700
committerKeith Packard <>2010-06-05 21:24:54 -0700
commitdf534d05208436e9ca8c9b42acff3fbe240e3ec4 (patch)
parente7fc8b32e41e10c057d2787fcc377296be67f2e9 (diff)
Make GetPictureScreenIfSet check if Render is running
This macro originally checked to see if the Render screen private index had been allocated. When the privates were changed the first time, there wasn't any need to check as dixLookupPrivate would simply return NULL in that case. Now that we care, check to see if the key has been initialized before asking for the value. Reviewed-by: Jamey Sharp <> Signed-off-by: Keith Packard <>
1 files changed, 1 insertions, 1 deletions
diff --git a/render/picturestr.h b/render/picturestr.h
index da69ff601..5c6c41e23 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -407,7 +407,7 @@ extern _X_EXPORT RESTYPE PictFormatType;
extern _X_EXPORT RESTYPE GlyphSetType;
#define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey))
-#define GetPictureScreenIfSet(s) GetPictureScreen(s)
+#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL)
#define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p)
#define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey))
#define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p)