From cd57646835c86cd0a1c7f0137afed18624b3fe43 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 10 Nov 2000 18:20:34 +0000 Subject: [PATCH] Put back check for root menu. --- src/defaults.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/defaults.c b/src/defaults.c index 7d902ed7..02a7cf8a 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -83,6 +83,7 @@ extern proplist_t ReadProplistFromFile(char *file); extern WDDomain *WDWindowMaker; extern WDDomain *WDWindowAttributes; +extern WDDomain *WDRootMenu; extern int wScreenCount; @@ -1151,6 +1152,33 @@ wDefaultsCheckDomains(void *foo) WDWindowAttributes->timestamp = stbuf.st_mtime; } +#ifndef LITE + if (stat(WDRootMenu->path, &stbuf)>=0 + && WDRootMenu->timestamp < stbuf.st_mtime) { + dict = ReadProplistFromFile(WDRootMenu->path); +#ifdef HEARTBEAT + puts("Checking WMRootMenu domain"); +#endif + if (dict) { + if (!PLIsArray(dict) && !PLIsString(dict)) { + PLRelease(dict); + dict = NULL; + wwarning(_("Domain %s (%s) of defaults database is corrupted!"), + "WMRootMenu", WDRootMenu->path); + } else { + if (WDRootMenu->dictionary) { + PLRelease(WDRootMenu->dictionary); + } + WDRootMenu->dictionary = dict; + } + } else { + wwarning(_("could not load domain %s from user defaults database"), + "WMRootMenu"); + } + WDRootMenu->timestamp = stbuf.st_mtime; + } +#endif /* !LITE */ + if (!foo) WMAddTimerHandler(DEFAULTS_CHECK_INTERVAL, wDefaultsCheckDomains, foo); }