aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/dix
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/dix')
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c10
-rw-r--r--nx-X11/programs/Xserver/dix/main.c3
2 files changed, 13 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index 3869ef723..16b94301f 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -112,6 +112,7 @@ int ProcInitialConnection();
#include "inputstr.h"
#include "xkbsrv.h"
#endif
+#include "client.h"
#define mskcnt ((MAXCLIENTS + 31) / 32)
#define BITMASK(i) (1U << ((i) & 31))
@@ -3560,6 +3561,9 @@ CloseDownClient(register ClientPtr client)
CallCallbacks((&ClientStateCallback), (void *)&clientinfo);
}
FreeClientResources(client);
+ /* Disable client ID tracking. This must be done after
+ * ClientStateCallback. */
+ ReleaseClientIds(client);
if (client->index < nextFreeClientID)
nextFreeClientID = client->index;
clients[client->index] = NullClient;
@@ -3643,6 +3647,7 @@ void InitClient(ClientPtr client, int i, void * ospriv)
client->smart_start_tick = SmartScheduleTime;
client->smart_stop_tick = SmartScheduleTime;
client->smart_check_tick = SmartScheduleTime;
+ client->clientIds = NULL;
}
extern int clientPrivateLen;
@@ -3724,6 +3729,11 @@ ClientPtr NextAvailableClient(void * ospriv)
currentMaxClients++;
while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID])
nextFreeClientID++;
+
+ /* Enable client ID tracking. This must be done before
+ * ClientStateCallback. */
+ ReserveClientIds(client);
+
if (ClientStateCallback)
{
NewClientInfoRec clientinfo;
diff --git a/nx-X11/programs/Xserver/dix/main.c b/nx-X11/programs/Xserver/dix/main.c
index 7bd41d865..50bbeb3dc 100644
--- a/nx-X11/programs/Xserver/dix/main.c
+++ b/nx-X11/programs/Xserver/dix/main.c
@@ -100,6 +100,7 @@ Equipment Corporation.
#include "site.h"
#include "dixfont.h"
#include "extnsionst.h"
+#include "client.h"
#ifdef PANORAMIX
#include "panoramiXsrv.h"
#else
@@ -382,6 +383,7 @@ main(int argc, char *argv[], char *envp[])
InitInput(argc, argv);
if (InitAndStartDevices() != Success)
FatalError("failed to initialize core devices");
+ ReserveClientIds(serverClient);
InitFonts();
if (loadableFonts) {
@@ -470,6 +472,7 @@ main(int argc, char *argv[], char *envp[])
#endif
FreeAuditTimer();
+ ReleaseClientIds(serverClient);
free(serverClient->devPrivates);
serverClient->devPrivates = NULL;