From 4637c09d19570050158851109d9df92e3c18db58 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Jan 2001 03:04:02 +0000 Subject: [PATCH] - Added Jim Knoble's 'no polling' patch. --- AUTHORS | 2 +- ChangeLog | 1 + NEWS | 15 +++++++++++++++ src/WindowMaker.h | 2 ++ src/event.c | 3 +++ src/main.c | 5 +++++ src/startup.c | 19 ++++++++++++++++++- 7 files changed, 45 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index d8308a46..b92b17cd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -102,7 +102,7 @@ EMACS/keypad like cursor movement for WINGs textfield Jim Knoble made autoarrange icons a runtime option, SHADOW_RESIZEBAR c-time option, no workspace switch to the same workspace, dashed icon selection, -misclellaneous bug fixes, definable cursors.. +misclellaneous bug fixes, definable cursors, --no-polling command line option. The JED Text Editor Project maintainer diff --git a/ChangeLog b/ChangeLog index c71342c1..dfd6748f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Changes since version 0.63.1: - Renamed se.po to sv.po - New version of wkdemenu.pl (from Malcolm Cowe ) - new updated Slovak translations (Jan Tomka/judas@hell ) +- integrated the 'no polling' patch from Jim Knoble . Changes since version 0.63.0: diff --git a/NEWS b/NEWS index 66a9cb1f..dd563a9d 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,21 @@ NEWS for veteran Window Maker users ----------------------------------- +--- 0.63.2 + +No Polling of Configuration Files +--------------------------------- + +Running Window Maker with one of -nopolling or --no-polling command line +options will make it not to poll every 3 seconds for changes in its +configuration files (good for laptops to let them spin disks down when idle). + +Note: +For the ones used with Jim Knoble's 'no polling' patch, this is the same, +except that the need to #define ENABLE_NO_POLLING in wconfig.h was removed +and the behaviour is always available if you use the command line option. + + --- 0.63.0 diff --git a/src/WindowMaker.h b/src/WindowMaker.h index ef63accf..d4864ed1 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -232,6 +232,7 @@ typedef enum { #define WSTATE_EXITING 3 #define WSTATE_RESTARTING 4 #define WSTATE_MODAL 5 +#define WSTATE_NEED_REREAD 6 #define WCHECK_STATE(state) (state == WProgramState) @@ -437,6 +438,7 @@ typedef struct WPreferences { unsigned int noautolaunch:1; /* don't autolaunch apps */ unsigned int norestore:1; /* don't restore session */ unsigned int create_stdcmap:1; /* create std colormap */ + unsigned int nopolling:1; /* don't poll for defaults changes */ } flags; /* internal flags */ } WPreferences; diff --git a/src/event.c b/src/event.c index 2ad6875b..68344fd2 100644 --- a/src/event.c +++ b/src/event.c @@ -219,6 +219,9 @@ DispatchEvent(XEvent *event) Shutdown(WSRestartPreparationMode); /* received SIGHUP */ Restart(NULL, True); + } else if (WCHECK_STATE(WSTATE_NEED_REREAD)) { + WCHANGE_STATE(WSTATE_NORMAL); + wDefaultsCheckDomains("bla"); } /* for the case that all that is wanted to be dispatched is diff --git a/src/main.c b/src/main.c index 49b336df..b53dc54d 100644 --- a/src/main.c +++ b/src/main.c @@ -433,6 +433,7 @@ print_help() puts(_(" --create-stdcmap create the standard colormap hint in PseudoColor visuals")); puts(_(" --visual-id visualid visual id of visual to use")); puts(_(" --static do not update or save configurations")); + puts(_(" --no-polling do not periodically check for configuration updates")); #ifdef DEBUG puts(_(" --synchronous turn on synchronous display mode")); #endif @@ -643,6 +644,10 @@ main(int argc, char **argv) || strcmp(argv[i], "--static")==0) { wPreferences.flags.noupdates = 1; + } else if (strcmp(argv[i], "-nopolling")==0 + || strcmp(argv[i], "--no-polling")==0) { + + wPreferences.flags.nopolling = 1; #ifdef XSMP_ENABLED } else if (strcmp(argv[i], "-clientid")==0 || strcmp(argv[i], "-restore")==0) { diff --git a/src/startup.c b/src/startup.c index 2fb1d689..87b64d05 100644 --- a/src/startup.c +++ b/src/startup.c @@ -278,6 +278,22 @@ handleSig(int sig) WMAddIdleHandler(delayedAction, NULL); } return; + } 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; } else if (sig == SIGTERM || sig == SIGHUP) { #ifdef SYS_SIGLIST_DECLARED wwarning(_("got signal %i (%s) - exiting...\n"), sig, sys_siglist[sig]); @@ -796,6 +812,7 @@ StartUp(Bool defaultScreenOnly) * -Dan */ sig_action.sa_flags = SA_RESTART; sigaction(SIGUSR1, &sig_action, NULL); + sigaction(SIGUSR2, &sig_action, NULL); /* ignore dead pipe */ sig_action.sa_handler = ignoreSig; @@ -955,7 +972,7 @@ StartUp(Bool defaultScreenOnly) Exit(1); } - if (!wPreferences.flags.noupdates) { + if (!wPreferences.flags.nopolling && !wPreferences.flags.noupdates) { /* setup defaults file polling */ WMAddTimerHandler(3000, wDefaultsCheckDomains, NULL); } -- 2.11.4.GIT