]> git.decadent.org.uk Git - ion3.git/blobdiff - mod_statusbar/main.c
Merged all changes to use x-terminal-emulator into 206_use-xterm.diff.
[ion3.git] / mod_statusbar / main.c
index 9ec4f20c0aac1a91ac5f346a38c8bc5f6a7dbbe5..2e84bf3d3616adcb6786eaa94675e31a2124a9b8 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/mod_statusbar/main.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2006
+ * Copyright (c) Tuomo Valkonen 1999-2007
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <sys/time.h>
 #include <libextl/readconfig.h>
 #include <libmainloop/exec.h>
 #include <libmainloop/select.h>
+#include <libmainloop/signal.h>
 #include <ioncore/saveload.h>
 #include <ioncore/bindmaps.h>
 #include <ioncore/global.h>
+#include <ioncore/ioncore.h>
 
 #include "statusbar.h"
 #include "exports.h"
 
 
-#define CF_STATUSD_TIMEOUT_SEC 5
+#define CF_STATUSD_TIMEOUT_SEC 3
 
 
 /*{{{ Module information */
@@ -94,9 +93,8 @@ static bool wait_statusd_init(int outfd, int errfd, ExtlFn dh, ExtlFn eh)
     int nfds=maxof(outfd, errfd);
     int retval;
     bool dummy, doneseen, eagain=FALSE;
-    const char *timeout_msg=TR("ion-statusd launch timeout.");
     
-    if(gettimeofday(&endtime, NULL)!=0){
+    if(mainloop_gettime(&endtime)!=0){
         warn_err();
         return FALSE;
     }
@@ -148,7 +146,7 @@ static bool wait_statusd_init(int outfd, int errfd, ExtlFn dh, ExtlFn eh)
             goto timeout;
         }
         
-        if(gettimeofday(&now, NULL)!=0){
+        if(mainloop_gettime(&now)!=0){
             warn_err();
             return FALSE;
         }
@@ -157,8 +155,13 @@ static bool wait_statusd_init(int outfd, int errfd, ExtlFn dh, ExtlFn eh)
     return TRUE;
     
 timeout:
-    warn(TR("ion-statusd timed out."));
-    return FALSE;
+    /* Just complain to stderr, not startup error log, and do not fail.
+     * The system might just be a bit slow. We can continue, but without
+     * initial values for the meters, geometry adjustments may be necessary
+     * when we finally get that information.
+     */
+    ioncore_warn_nolog(TR("ion-statusd timed out."));
+    return TRUE;
 }
 
 
@@ -255,7 +258,7 @@ static bool clientwin_do_manage_hook(WClientWin *cwin, const WManageParams *para
         return FALSE;
 
     return region_manage_clientwin((WRegion*)sb, cwin, param,
-                                   MANAGE_REDIR_PREFER_NO);
+                                   MANAGE_PRIORITY_NONE);
 }