summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-05-20 12:39:28 -0700
committerAaron Plattner <aplattner@nvidia.com>2008-05-20 14:11:37 -0700
commitb69c74d14b7a777ae02aee0a8ff81efbff8cca6e (patch)
tree39cb6f64f5f311c3b074b17f69550d6a9c28a334
parent5efe36f7afde8b5bf4e853dd1dde2a6a027d613b (diff)
Short-circuit PanoramiXTranslateVisualID after verifying that the visual actually exists first.
This allows using PanoramiXTranslateVisualID to test whether a given visual made it through PanoramiXVisualConsolidate. (cherry picked from commit 8b3d26f5b6caff1766669deb0e2100d2dee3f185)
-rw-r--r--Xext/panoramiX.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index eb7068925..2792dc714 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -850,10 +850,6 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
VisualPtr pVisual = NULL;
int i;
- /* if screen is 0, orig is already the correct visual ID */
- if (screen == 0)
- return orig;
-
for (i = 0; i < PanoramiXNumVisuals; i++) {
if (orig == PanoramiXVisuals[i].vid) {
pVisual = &PanoramiXVisuals[i];
@@ -864,6 +860,10 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
if (!pVisual)
return 0;
+ /* if screen is 0, orig is already the correct visual ID */
+ if (screen == 0)
+ return orig;
+
/* found the original, now translate it relative to the backend screen */
for (i = 0; i < pOtherScreen->numVisuals; i++) {
VisualPtr pOtherVisual = &pOtherScreen->visuals[i];