diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-06 00:53:06 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-06 00:53:06 +0100 |
commit | 67599026d01692c52276df6ff5e8332d2413c18f (patch) | |
tree | b93b8d6643dd6438f0844d48008d6cb9ffee405f /nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | |
parent | 5a8f1e921b4cafedc9efac22d5fbd2ce05e45ba9 (diff) | |
parent | cf8797c3c0e9623e5092a2c9f5ea7cb31bc11657 (diff) | |
download | nx-libs-67599026d01692c52276df6ff5e8332d2413c18f.tar.gz nx-libs-67599026d01692c52276df6ff5e8332d2413c18f.tar.bz2 nx-libs-67599026d01692c52276df6ff5e8332d2413c18f.zip |
Merge branch 'uli42-pr/various3' into 3.6.x
Attributes GH PR #880: https://github.com/ArcticaProject/nx-libs/pull/880
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 00fb4ddd8..e804acbd2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -200,6 +200,12 @@ extern int nxagentMaxSelections; extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*); + +/* + * This used to be a dix variable used only by XPRINT, so xorg dropped it. + */ +ClientPtr nxagentRequestingClient; + void InitSelections(void) { @@ -245,6 +251,7 @@ Dispatch(void) InitSelections(); nClients = 0; +#ifdef NXAGENT_SERVER /* * The agent initialization was successfully * completed. We can now handle our clients. @@ -269,10 +276,12 @@ Dispatch(void) #endif +#endif /* NXAGENT_SERVER */ clientReady = (int *) malloc(sizeof(int) * MaxClients); if (!clientReady) return; +#ifdef NXAGENT_SERVER #ifdef WATCH fprintf(stderr, "Dispatch: Watchpoint 12.\n"); @@ -303,6 +312,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio if (!(dispatchException & DE_TERMINATE)) dispatchException = 0; +#endif /* NXAGENT_SERVER */ while (!dispatchException) { @@ -312,6 +322,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio FlushIfCriticalOutputPending(); } +#ifdef NXAGENT_SERVER /* * Ensure we remove the splash after the timeout. * Initializing clientReady[0] to -1 will tell @@ -351,9 +362,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio #ifdef BLOCKS fprintf(stderr, "[End dispatch]\n"); #endif +#endif /* NXAGENT_SERVER */ nready = WaitForSomething(clientReady); +#ifdef NXAGENT_SERVER #ifdef BLOCKS fprintf(stderr, "[Begin dispatch]\n"); #endif @@ -378,6 +391,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio nxagentClients = nClients; #endif +#endif /* NXAGENT_SERVER */ if (nready) { @@ -405,7 +419,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio } isItTimeToYield = FALSE; - requestingClient = client; +#ifdef NXAGENT_SERVER + nxagentRequestingClient = client; +#endif start_tick = SmartScheduleTime; while (!isItTimeToYield) { @@ -423,10 +439,15 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio } /* now, finally, deal with client requests */ + /* Update currentTime so request time checks, such as for input + * device grabs, are calculated correctly */ + UpdateCurrentTimeIf(); +#ifdef NXAGENT_SERVER #ifdef TEST fprintf(stderr, "******Dispatch: Reading request from client [%d].\n", client->index); #endif +#endif /* NXAGENT_SERVER */ result = ReadRequestFromClient(client); if (result <= 0) @@ -435,8 +456,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio CloseDownClient(client); break; } -#ifdef NXAGENT_SERVER +#ifdef NXAGENT_SERVER #ifdef TEST else @@ -463,10 +484,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio if (result > (maxBigRequestSize << 2)) result = BadLength; else -#ifdef NXAGENT_SERVER { result = (* client->requestVector[MAJOROP])(client); - +#ifdef NXAGENT_SERVER #ifdef TEST if (MAJOROP > 127) @@ -492,11 +512,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio */ nxagentDispatchHandler(client, client->req_len << 2, 0); - } -#else - result = (* client->requestVector[MAJOROP])(client); #endif - + } if (!SmartScheduleSignalEnable) SmartScheduleTime = GetTimeInMillis(); @@ -519,13 +536,17 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio client = clients[clientReady[nready]]; if (client) client->smart_stop_tick = SmartScheduleTime; - requestingClient = NULL; +#ifdef NXAGENT_SERVER + nxagentRequestingClient = NULL; +#endif } dispatchException &= ~DE_PRIORITYCHANGE; } #if defined(DDXBEFORERESET) ddxBeforeReset (); #endif + +#ifdef NXAGENT_SERVER /* FIXME: maybe move the code up to the KillAllClients() call to ddxBeforeReset? */ if ((dispatchException & DE_RESET) && (serverGeneration > nxagentMaxAllowedResets)) @@ -559,6 +580,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio NXShadowDestroy(); } saveAgentState("TERMINATED"); +#endif /* NXAGENT_SERVER */ KillAllClients(); free(clientReady); @@ -580,7 +602,9 @@ ProcReparentWindow(register ClientPtr client) if (!pWin) return(BadWindow); +#ifdef NXAGENT_SERVER nxagentRemoveSplashWindow(); +#endif pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, DixWriteAccess); @@ -807,7 +831,7 @@ ProcCloseFont(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, DixDestroyAccess); - if (pFont != (FontPtr)NULL) + if ( pFont != (FontPtr)NULL) /* id was valid */ { #ifdef NXAGENT_SERVER @@ -1140,6 +1164,8 @@ CloseDownClient(register ClientPtr client) xorg_CloseDownClient(client); } +/* FIXME: Instead of having a own function use the provided Callback + mechanism */ int InitClientPrivates(ClientPtr client) { |