--- ./src/WindowMaker.h.orig-nopolling Mon Apr 3 01:05:42 2000 +++ ./src/WindowMaker.h Mon Apr 3 02:22:48 2000 @@ -226,6 +226,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) @@ -426,6 +429,9 @@ unsigned int noupdates:1; /* don't require ~/GNUstep (-static) */ unsigned int noautolaunch:1; /* don't autolaunch apps */ unsigned int norestore:1; /* don't restore session */ +#ifdef ENABLE_NO_POLLING + unsigned int nopolling:1; /* don't poll for changed defaults */ +#endif } flags; /* internal flags */ } WPreferences; --- ./src/main.c.orig-nopolling Mon Apr 3 01:05:49 2000 +++ ./src/main.c Mon Apr 3 02:23:56 2000 @@ -642,6 +642,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 Apr 3 01:06:08 2000 +++ ./src/startup.c Mon Apr 3 02:25:52 2000 @@ -273,6 +273,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]); @@ -786,6 +804,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; @@ -945,7 +966,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 Apr 3 02:19:30 2000 +++ ./src/event.c Mon Apr 3 02:26:41 2000 @@ -220,6 +220,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 Apr 3 02:19:30 2000 +++ ./src/wconfig.h.in Mon Apr 3 02:30:29 2000 @@ -188,6 +188,16 @@ #define SILLYNESS +/* + * 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 + +