summaryrefslogtreecommitdiff
path: root/Xext
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:19 -0700
commit8b3d26f5b6caff1766669deb0e2100d2dee3f185 (patch)
tree7fd1e093dbb4f6ac4819606b4198b7d184429369 /Xext
parent6ff6465931c397f72db27a4fd0ca0dcac0609537 (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.
Diffstat (limited to 'Xext')
-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];