dix: SendConnSetup: clean up numscreens handling

Usually, we would use screenInfo.numScreens, but Xinerama has a special
handling that's taking the number from the already compiled ConnectionInfo's
numRoots field.

Actually, we don't need any special handling here, just take the numroots
field, because in non-xinerama case, it's equal to screenInfo.numScreens.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2026-09-23 19:11:32 +02:00 • committed by Enrico Weigelt
commit 7fb91cf8c0

View file

@ -3840,7 +3840,6 @@ static int
SendConnSetup(ClientPtr client, const char *reason)
{
xWindowRoot *root;
int numScreens;
char *lConnectionInfo;
xConnSetupPrefix *lconnSetupPrefix;
@ -3860,7 +3859,6 @@ SendConnSetup(ClientPtr client, const char *reason)
return client->noClientException = -1;
}
numScreens = screenInfo.numScreens;
lConnectionInfo = ConnectionInfo;
lconnSetupPrefix = &connSetupPrefix;
@ -3881,12 +3879,8 @@ SendConnSetup(ClientPtr client, const char *reason)
#endif
/* fill in the "currentInputMask" */
root = (xWindowRoot *) (lConnectionInfo + connBlockScreenStart);
#ifdef XINERAMA
if (PanoramiXIsDisabled())
numScreens = screenInfo.numScreens;
else
numScreens = ((xConnSetup *) ConnectionInfo)->numRoots;
#endif /* XINERAMA */
int numScreens = ((xConnSetup *) ConnectionInfo)->numRoots;
for (unsigned int walkScreenIdx = 0; walkScreenIdx < numScreens; walkScreenIdx++) {
ScreenPtr walkScreen = screenInfo.screens[walkScreenIdx];