This commit is contained in:
Enrico Weigelt, metux IT consult 2024-09-03 14:30:21 +02:00
parent 6c9ef7905a
commit 3a317cdd8b
4 changed files with 26 additions and 3 deletions

View File

@ -565,6 +565,8 @@ Dispatch(void)
#if XTRANS_SEND_FDS
/* close down all unused passed fd's */
for (int x=0; x<MAX_CLIENT_RECV_FD; x++) {
if (client->recv_fd_list[x] >= 0)
fprintf(stderr, "closing unused received fd: %d\n", client->recv_fd_list[x]);
close(client->recv_fd_list[x]);
client->recv_fd_list[x] = -1;
}
@ -581,6 +583,7 @@ Dispatch(void)
#endif
if (client->noClientException != Success) {
fprintf(stderr, "calling CloseDownClient() II\n");
CloseDownClient(client);
break;
}
@ -3351,8 +3354,10 @@ CloseDownRetainedResources(void)
for (i = 1; i < currentMaxClients; i++) {
client = clients[i];
if (client && (client->closeDownMode == RetainTemporary)
&& (client->clientGone))
&& (client->clientGone)) {
fprintf(stderr, "calling CloseDownClient (retained)\n");
CloseDownClient(client);
}
}
}
@ -3363,6 +3368,8 @@ ProcKillClient(ClientPtr client)
ClientPtr killclient;
int rc;
fprintf(stderr, "ProcKillClient\n");
REQUEST_SIZE_MATCH(xResourceReq);
if (stuff->id == AllTemporary) {
CloseDownRetainedResources();
@ -3505,6 +3512,8 @@ CloseDownClient(ClientPtr client)
Bool really_close_down = client->clientGone ||
client->closeDownMode == DestroyAll;
fprintf(stderr, "in CloseDownClient()\n");
if (!client->clientGone) {
/* ungrab server if grabbing client dies */
if (grabState != GrabNone && grabClient == client) {
@ -3538,6 +3547,7 @@ CloseDownClient(ClientPtr client)
if (ClientIsAsleep(client))
ClientSignal(client);
ProcessWorkQueueZombies();
fprintf(stderr, "calling CloseDownConnection\n");
CloseDownConnection(client);
output_pending_clear(client);
mark_client_not_ready(client);
@ -3584,8 +3594,12 @@ CloseDownClient(ClientPtr client)
currentMaxClients--;
}
if (ShouldDisconnectRemainingClients())
if (ShouldDisconnectRemainingClients()) {
fprintf(stderr, "ShouldDisconnectRemainingClients() enabled\n");
SetDispatchExceptionTimer();
} else {
fprintf(stderr, "ShouldDisconnectRemainingClients() disabled\n");
}
}
static void
@ -3593,6 +3607,8 @@ KillAllClients(void)
{
int i;
fprintf(stderr, "KillAllClients()\n");
for (i = 1; i < currentMaxClients; i++)
if (clients[i]) {
/* Make sure Retained clients are released. */

View File

@ -154,6 +154,7 @@ lnxACPIOpen(void)
LogMessageVerb(X_WARNING, 3, "Open ACPI failed (%s) (%s)\n",
ACPI_SOCKET, strerror(errno));
warned = 1;
fprintf(stderr, "shutdown()\n");
shutdown(fd, 2);
close(fd);
return NULL;
@ -177,6 +178,7 @@ lnxCloseACPI(void)
DebugF("ACPI: Closing device\n");
if (ACPIihPtr) {
fd = xf86RemoveGeneralHandler(ACPIihPtr);
fprintf(stderr, "shutdown()\n");
shutdown(fd, 2);
close(fd);
ACPIihPtr = NULL;

View File

@ -140,6 +140,8 @@ xnestCloseDisplay(void)
xnestVisualMap = NULL;
xnestNumVisualMap = 0;
fprintf(stderr, "xnestCloseDisplay()\n");
xcb_disconnect(xnestUpstreamInfo.conn);
xnestUpstreamInfo.conn = NULL;
xnestUpstreamInfo.screenInfo = NULL;

View File

@ -194,10 +194,13 @@ xnest_handle_event(xcb_generic_event_t *event)
case DestroyNotify:
{
fprintf(stderr, "DestroyNotify\n");
xcb_destroy_notify_event_t *ev = (xcb_destroy_notify_event_t*)event;
if (xnestParentWindow &&
ev->window == xnestParentWindow)
ev->window == xnestParentWindow) {
fprintf(stderr, "it's our parent window\n");
exit(0);
}
break;
}