|
|
cd95b5f |
diff -uNr -B -b WindowMaker-0.92.0/src/defaults.c WindowMaker-0.92.0-dnotify2/src/defaults.c
|
|
|
cd95b5f |
--- WindowMaker-0.92.0/src/defaults.c 2005-04-08 07:59:16.000000000 -0300
|
|
|
cd95b5f |
+++ WindowMaker-0.92.0-dnotify2/src/defaults.c 2007-06-27 23:26:46.000000000 -0300
|
|
|
cd95b5f |
@@ -1348,8 +1348,6 @@
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
#endif /* !LITE */
|
|
|
cd95b5f |
|
|
|
cd95b5f |
- if (!foo)
|
|
|
cd95b5f |
- WMAddTimerHandler(DEFAULTS_CHECK_INTERVAL, wDefaultsCheckDomains, foo);
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
|
|
|
cd95b5f |
|
|
|
cd95b5f |
diff -uNr -B -b WindowMaker-0.92.0/src/event.c WindowMaker-0.92.0-dnotify2/src/event.c
|
|
|
cd95b5f |
--- WindowMaker-0.92.0/src/event.c 2005-03-12 21:13:55.000000000 -0300
|
|
|
cd95b5f |
+++ WindowMaker-0.92.0-dnotify2/src/event.c 2007-06-27 23:26:50.000000000 -0300
|
|
|
cd95b5f |
@@ -319,10 +319,20 @@
|
|
|
cd95b5f |
EventLoop()
|
|
|
cd95b5f |
{
|
|
|
cd95b5f |
XEvent event;
|
|
|
cd95b5f |
+ extern volatile int filesChanged;
|
|
|
cd95b5f |
+ extern void wDefaultsCheckDomains();
|
|
|
cd95b5f |
|
|
|
cd95b5f |
for(;;) {
|
|
|
cd95b5f |
WMNextEvent(dpy, &event);
|
|
|
cd95b5f |
WMHandleEvent(&event);
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
+ /* If configuration files in defaults database have
|
|
|
cd95b5f |
+ changed we read them. */
|
|
|
cd95b5f |
+ if (filesChanged){
|
|
|
cd95b5f |
+ fprintf(stdout,"Rereading config files in defaults database...\n");
|
|
|
cd95b5f |
+ wDefaultsCheckDomains(NULL);
|
|
|
cd95b5f |
+ filesChanged = 0;
|
|
|
cd95b5f |
+ }
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
|
|
|
cd95b5f |
diff -uNr -B -b WindowMaker-0.92.0/src/main.c WindowMaker-0.92.0-dnotify2/src/main.c
|
|
|
cd95b5f |
--- WindowMaker-0.92.0/src/main.c 2004-10-24 22:32:51.000000000 -0300
|
|
|
cd95b5f |
+++ WindowMaker-0.92.0-dnotify2/src/main.c 2007-06-27 23:26:56.000000000 -0300
|
|
|
cd95b5f |
@@ -19,6 +19,14 @@
|
|
|
cd95b5f |
* USA.
|
|
|
cd95b5f |
*/
|
|
|
cd95b5f |
|
|
|
cd95b5f |
+/* The notify code was copied from Documentation/dnotify.txt
|
|
|
cd95b5f |
+ * in the linux kernel.
|
|
|
cd95b5f |
+ */
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
+#define _GNU_SOURCE /* needed to get the defines in glibc 2.2 */
|
|
|
cd95b5f |
+#include <fcntl.h> /* this has the needed values defined */
|
|
|
cd95b5f |
+#include <signal.h>
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
#include "wconfig.h"
|
|
|
cd95b5f |
|
|
|
cd95b5f |
#include <stdio.h>
|
|
|
cd95b5f |
@@ -62,6 +70,7 @@
|
|
|
cd95b5f |
char *ProgName;
|
|
|
cd95b5f |
|
|
|
cd95b5f |
unsigned int ValidModMask = 0xff;
|
|
|
cd95b5f |
+volatile int filesChanged;
|
|
|
cd95b5f |
|
|
|
cd95b5f |
/* locale to use. NULL==POSIX or C */
|
|
|
cd95b5f |
char *Locale=NULL;
|
|
|
cd95b5f |
@@ -451,7 +460,6 @@
|
|
|
cd95b5f |
puts(_(" --create-stdcmap create the standard colormap hint in PseudoColor visuals"));
|
|
|
cd95b5f |
puts(_(" --visual-id visualid visual id of visual to use"));
|
|
|
cd95b5f |
puts(_(" --static do not update or save configurations"));
|
|
|
cd95b5f |
- puts(_(" --no-polling do not periodically check for configuration updates"));
|
|
|
cd95b5f |
#ifdef DEBUG
|
|
|
cd95b5f |
puts(_(" --synchronous turn on synchronous display mode"));
|
|
|
cd95b5f |
#endif
|
|
|
cd95b5f |
@@ -490,10 +498,32 @@
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
|
|
|
cd95b5f |
|
|
|
cd95b5f |
+/* This is the handler used to notify if configuration
|
|
|
cd95b5f |
+ * files have changed.
|
|
|
cd95b5f |
+ */
|
|
|
cd95b5f |
+void handler(int sig, siginfo_t *si, void *data)
|
|
|
cd95b5f |
+{
|
|
|
cd95b5f |
+ filesChanged = si->si_fd;
|
|
|
cd95b5f |
+}
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
static void
|
|
|
cd95b5f |
execInitScript()
|
|
|
cd95b5f |
{
|
|
|
cd95b5f |
- char *file, *paths;
|
|
|
cd95b5f |
+ char *file, *path, *paths;
|
|
|
cd95b5f |
+ struct sigaction act;
|
|
|
cd95b5f |
+ volatile int fd;
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
+ path = wstrconcat(wusergnusteppath(), "/Defaults");
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
+ act.sa_sigaction = handler;
|
|
|
cd95b5f |
+ sigemptyset(&act.sa_mask);
|
|
|
cd95b5f |
+ act.sa_flags = SA_SIGINFO;
|
|
|
cd95b5f |
+ sigaction(SIGRTMIN + 1, &act, NULL);
|
|
|
cd95b5f |
+
|
|
|
cd95b5f |
+ fd = open(path, O_RDONLY);
|
|
|
cd95b5f |
+ fcntl(fd, F_SETSIG, SIGRTMIN + 1);
|
|
|
cd95b5f |
+ fcntl(fd, F_NOTIFY, DN_MODIFY|DN_MULTISHOT);
|
|
|
cd95b5f |
+ wfree(path);
|
|
|
cd95b5f |
|
|
|
cd95b5f |
paths = wstrconcat(wusergnusteppath(), "/Library/WindowMaker");
|
|
|
cd95b5f |
paths = wstrappend(paths, ":"DEF_CONFIG_PATHS);
|
|
|
cd95b5f |
@@ -746,10 +776,6 @@
|
|
|
cd95b5f |
|| strcmp(argv[i], "--static")==0) {
|
|
|
cd95b5f |
|
|
|
cd95b5f |
wPreferences.flags.noupdates = 1;
|
|
|
cd95b5f |
- } else if (strcmp(argv[i], "-nopolling")==0
|
|
|
cd95b5f |
- || strcmp(argv[i], "--no-polling")==0) {
|
|
|
cd95b5f |
-
|
|
|
cd95b5f |
- wPreferences.flags.nopolling = 1;
|
|
|
cd95b5f |
#ifdef XSMP_ENABLED
|
|
|
cd95b5f |
} else if (strcmp(argv[i], "-clientid")==0
|
|
|
cd95b5f |
|| strcmp(argv[i], "-restore")==0) {
|
|
|
cd95b5f |
diff -uNr -B -b WindowMaker-0.92.0/src/startup.c WindowMaker-0.92.0-dnotify2/src/startup.c
|
|
|
cd95b5f |
--- WindowMaker-0.92.0/src/startup.c 2005-03-11 22:11:30.000000000 -0300
|
|
|
cd95b5f |
+++ WindowMaker-0.92.0-dnotify2/src/startup.c 2007-06-27 23:27:10.000000000 -0300
|
|
|
cd95b5f |
@@ -885,10 +885,6 @@
|
|
|
cd95b5f |
Exit(1);
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
|
|
|
cd95b5f |
- if (!wPreferences.flags.nopolling && !wPreferences.flags.noupdates) {
|
|
|
cd95b5f |
- /* setup defaults file polling */
|
|
|
cd95b5f |
- WMAddTimerHandler(3000, wDefaultsCheckDomains, NULL);
|
|
|
cd95b5f |
- }
|
|
|
cd95b5f |
}
|
|
|
cd95b5f |
|
|
|
cd95b5f |
|
|
|
cd95b5f |
diff -uNr -B -b WindowMaker-0.92.0/src/wconfig.h.in WindowMaker-0.92.0-dnotify2/src/wconfig.h.in
|
|
|
cd95b5f |
--- WindowMaker-0.92.0/src/wconfig.h.in 2004-11-11 11:23:38.000000000 -0200
|
|
|
cd95b5f |
+++ WindowMaker-0.92.0-dnotify2/src/wconfig.h.in 2007-06-27 23:27:17.000000000 -0300
|
|
|
cd95b5f |
@@ -457,8 +457,6 @@
|
|
|
cd95b5f |
#define MAX_WINDOWLIST_WIDTH 160 /* max width of window title in
|
|
|
cd95b5f |
* window list */
|
|
|
cd95b5f |
|
|
|
cd95b5f |
-#define DEFAULTS_CHECK_INTERVAL 2000 /* how often wmaker will check for
|
|
|
cd95b5f |
- * changes in the config files */
|
|
|
cd95b5f |
|
|
|
cd95b5f |
/* if your keyboard don't have arrow keys */
|
|
|
cd95b5f |
#undef ARROWLESS_KBD
|
|
|
cd95b5f |
diff -uNr -B -b WindowMaker-0.92.0/src/WindowMaker.h WindowMaker-0.92.0-dnotify2/src/WindowMaker.h
|
|
|
cd95b5f |
--- WindowMaker-0.92.0/src/WindowMaker.h 2004-10-24 22:48:39.000000000 -0300
|
|
|
cd95b5f |
+++ WindowMaker-0.92.0-dnotify2/src/WindowMaker.h 2007-06-27 23:27:21.000000000 -0300
|
|
|
cd95b5f |
@@ -483,7 +483,6 @@
|
|
|
cd95b5f |
unsigned int noautolaunch:1; /* don't autolaunch apps */
|
|
|
cd95b5f |
unsigned int norestore:1; /* don't restore session */
|
|
|
cd95b5f |
unsigned int create_stdcmap:1; /* create std colormap */
|
|
|
cd95b5f |
- unsigned int nopolling:1; /* don't poll for defaults changes */
|
|
|
cd95b5f |
unsigned int restarting:2;
|
|
|
cd95b5f |
} flags; /* internal flags */
|
|
|
cd95b5f |
} WPreferences;
|
|
|
cd95b5f |
|