--- ./src/WindowMaker.h.orig-nopolling Mon Nov 8 06:24:59 1999 +++ ./src/WindowMaker.h Mon Nov 8 06:24:59 1999 @@ -225,6 +225,9 @@ #define WSTATE_EXITING 3 #define WSTATE_RESTARTING 4 #define WSTATE_MODAL 5 +#ifdef ENABLE_NO_POLLING +#define WSTATE_NEED_REREAD 6 +#endif #define WCHECK_STATE(state) (state == WProgramState) @@ -415,6 +418,9 @@ unsigned int noclip:1; /* don't display the clip */ unsigned int nocpp:1; /* don't use cpp */ unsigned int noupdates:1; /* don't require ~/GNUstep (-static) */ +#ifdef ENABLE_NO_POLLING + unsigned int nopolling:1; /* don't poll for changed defaults */ +#endif } flags; /* internal flags */ } WPreferences; --- ./src/main.c.orig-nopolling Tue Oct 26 00:19:27 1999 +++ ./src/main.c Mon Nov 8 06:24:59 1999 @@ -631,6 +631,17 @@ || strcmp(argv[i], "--static")==0) { wPreferences.flags.noupdates = 1; +#ifdef ENABLE_NO_POLLING + wPreferences.flags.nopolling = 1; +#endif + } else if (strcmp(argv[i], "-nopolling")==0 + || strcmp(argv[i], "--no-polling")==0) { + +#ifdef ENABLE_NO_POLLING + wPreferences.flags.nopolling = 1; +#else + wwarning(_("%s option not implemented"), argv[i]); +#endif #ifdef XSMP_ENABLED } else if (strcmp(argv[i], "-clientid")==0 || strcmp(argv[i], "-restore")==0) { --- ./src/startup.c.orig-nopolling Mon Nov 8 06:24:59 1999 +++ ./src/startup.c Mon Nov 8 06:24:59 1999 @@ -270,6 +270,24 @@ WMAddIdleHandler(delayedAction, NULL); } return; +#ifdef ENABLE_NO_POLLING + } else if (sig == SIGUSR2) { +#ifdef SYS_SIGLIST_DECLARED + wwarning(_("got signal %i (%s) - rereading defaults\n"), sig, sys_siglist[sig]); +#else + wwarning(_("got signal %i - rereading defaults\n"), sig); +#endif + + WCHANGE_STATE(WSTATE_NEED_REREAD); + /* setup idle handler, so that this will be handled when + * the select() is returned becaused of the signal, even if + * there are no X events in the queue */ + if (!WDelayedActionSet) { + WDelayedActionSet = 1; + WMAddIdleHandler(delayedAction, NULL); + } + return; +#endif /* ENABLE_NO_POLLING */ } else if (sig == SIGTERM || sig == SIGHUP) { #ifdef SYS_SIGLIST_DECLARED wwarning(_("got signal %i (%s) - exiting...\n"), sig, sys_siglist[sig]); @@ -738,6 +756,9 @@ * -Dan */ sig_action.sa_flags = SA_RESTART; sigaction(SIGUSR1, &sig_action, NULL); +#ifdef ENABLE_NO_POLLING + sigaction(SIGUSR2, &sig_action, NULL); +#endif /* ignore dead pipe */ sig_action.sa_handler = ignoreSig; @@ -896,7 +917,11 @@ Exit(1); } +#ifdef ENABLE_NO_POLLING + if (!wPreferences.flags.nopolling) { +#else if (!wPreferences.flags.noupdates) { +#endif /* setup defaults file polling */ WMAddTimerHandler(3000, wDefaultsCheckDomains, NULL); } --- ./src/event.c.orig-nopolling Mon Nov 8 06:24:58 1999 +++ ./src/event.c Mon Nov 8 06:24:59 1999 @@ -218,6 +218,11 @@ Shutdown(WSRestartPreparationMode); /* received SIGHUP */ Restart(NULL, True); +#ifdef ENABLE_NO_POLLING + } else if (WCHECK_STATE(WSTATE_NEED_REREAD)) { + WCHANGE_STATE(WSTATE_NORMAL); + wDefaultsCheckDomains("bla"); +#endif } /* for the case that all that is wanted to be dispatched is --- ./src/wconfig.h.in.orig-nopolling Mon Nov 8 06:24:59 1999 +++ ./src/wconfig.h.in Mon Nov 8 06:25:47 1999 @@ -194,6 +194,16 @@ #undef NO_CRASHES +/* + * Define if you want the "--no-polling" command-line option enabled. + * This option tells Window Maker not to poll for changes in the + * defaults databases and enables an explicit reread on SIGUSR2. + * Useful for laptop or mobile environments where disks should be + * allowed to spin down. + */ +#define ENABLE_NO_POLLING + + /* *..........................................................................