aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c161
1 files changed, 6 insertions, 155 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index e804acbd2..ad9ce771f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -125,6 +125,7 @@ Equipment Corporation.
#include <nx/Shadow.h>
#include "Handlers.h"
#include "Keyboard.h"
+#include "Init.h"
const int nxagentMaxFontNames = 10000;
@@ -139,12 +140,6 @@ void nxagentWaitDisplay(void);
void nxagentListRemoteFonts(const char *, int);
-/*
- * Timeouts based on screen saver time.
- */
-
-int nxagentAutoDisconnectTimeout = 0;
-
#include "Xatom.h"
/*
@@ -312,6 +307,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (!(dispatchException & DE_TERMINATE))
dispatchException = 0;
+
+ /* Init TimeoutTimer if requested */
+ nxagentSetTimeoutTimer(0);
#endif /* NXAGENT_SERVER */
while (!dispatchException)
@@ -547,6 +545,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
#ifdef NXAGENT_SERVER
+ nxagentFreeTimeoutTimer();
+
/* FIXME: maybe move the code up to the KillAllClients() call to ddxBeforeReset? */
if ((dispatchException & DE_RESET) &&
(serverGeneration > nxagentMaxAllowedResets))
@@ -978,155 +978,6 @@ ProcFreePixmap(register ClientPtr client)
}
}
-
-int
-ProcSetScreenSaver (register ClientPtr client)
-{
- int blankingOption, exposureOption;
- REQUEST(xSetScreenSaverReq);
-
- REQUEST_SIZE_MATCH(xSetScreenSaverReq);
- blankingOption = stuff->preferBlank;
- if ((blankingOption != DontPreferBlanking) &&
- (blankingOption != PreferBlanking) &&
- (blankingOption != DefaultBlanking))
- {
- client->errorValue = blankingOption;
- return BadValue;
- }
- exposureOption = stuff->allowExpose;
- if ((exposureOption != DontAllowExposures) &&
- (exposureOption != AllowExposures) &&
- (exposureOption != DefaultExposures))
- {
- client->errorValue = exposureOption;
- return BadValue;
- }
- if (stuff->timeout < -1)
- {
- client->errorValue = stuff->timeout;
- return BadValue;
- }
- if (stuff->interval < -1)
- {
- client->errorValue = stuff->interval;
- return BadValue;
- }
-
-#ifdef NXAGENT_SERVER
- /*
- * The NX agent uses the screen saver procedure
- * to monitor the user activities and launch its
- * handlers (like timeout feature), so we can't
- * always allow the clients to change our values.
- */
-
- #ifdef TEST
- fprintf(stderr, "ProcSetScreenSaver: Called with timeout [%d] interval [%d] Blanking [%d] Exposure [%d].\n",
- stuff -> timeout, stuff -> interval, blankingOption, exposureOption);
- #endif
-
- if (nxagentOption(Timeout) == 0)
- {
-#endif
- if (blankingOption == DefaultBlanking)
- {
- ScreenSaverBlanking = defaultScreenSaverBlanking;
- }
- else
- {
- ScreenSaverBlanking = blankingOption;
- }
-
- if (exposureOption == DefaultExposures)
- {
- ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
- }
- else
- {
- ScreenSaverAllowExposures = exposureOption;
- }
-
- if (stuff->timeout >= 0)
- {
- ScreenSaverTime = stuff->timeout * MILLI_PER_SECOND;
- }
- else
- {
- ScreenSaverTime = defaultScreenSaverTime;
- }
-
- if (stuff->interval >= 0)
- {
- ScreenSaverInterval = stuff->interval * MILLI_PER_SECOND;
- }
- else
- {
- ScreenSaverInterval = defaultScreenSaverInterval;
- }
-
- SetScreenSaverTimer();
-#ifdef NXAGENT_SERVER
- }
-
- #ifdef TEST
-
- else
- {
- fprintf(stderr, "ProcSetScreenSaver: Keeping auto-disconnect timeout set to [%d] seconds.\n",
- nxagentOption(Timeout));
- }
-
- #endif
-#endif
- return (client->noClientException);
-}
-
-
-int ProcForceScreenSaver(register ClientPtr client)
-{
- REQUEST(xForceScreenSaverReq);
-
- REQUEST_SIZE_MATCH(xForceScreenSaverReq);
-
- if ((stuff->mode != ScreenSaverReset) &&
- (stuff->mode != ScreenSaverActive))
- {
- client->errorValue = stuff->mode;
- return BadValue;
- }
-
-#ifdef NXAGENT_SERVER
- /*
- * The NX agent uses the screen saver procedure
- * to monitor the user activities and launch its
- * handlers (like timeout feature), so we can't
- * always allow the clients to force the screen
- * saver handler execution.
- */
-
- if (nxagentOption(Timeout) == 0)
- {
-#endif
- SaveScreens(SCREEN_SAVER_FORCER, (int)stuff->mode);
-#ifdef NXAGENT_SERVER
- }
-
- #ifdef TEST
-
- else
- {
- fprintf(stderr, "ProcForceScreenSaver: Ignoring the client request with mode [%d].\n",
- stuff -> mode);
- }
-
- #endif
-#endif
-
- return client->noClientException;
-}
-
-
/**********************
* CloseDownClient
*