when 'hide window on startup' is set, it will
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 6 Oct 2012 10:11:32 +0000 (10:11 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 6 Oct 2012 10:11:32 +0000 (10:11 +0000)
   hide the window only if psensor can register to application
   indicator or systray. Waiting 30s before trying to do it
   in order to have better chance that systray is running during
   session startup.

NEWS
src/main.c

diff --git a/NEWS b/NEWS
index f47075c..99f90ee 100644 (file)
--- a/NEWS
+++ b/NEWS
 ** added faq (requires asciidoc to build the html version).
 ** check target is now running cppcheck if installed.
 ** display message if no graphs are enabled (Closes #689355).
+** psensor: when 'hide window on startup' is set, it will
+   hide the window only if psensor can register to application
+   indicator or systray. Waiting 30s before trying to do it
+   in order to have better chance that systray is running during
+   session startup.
 
 * v0.7.0.3
 
index 80e912e..4c16bf7 100644 (file)
@@ -613,12 +613,16 @@ int main(int argc, char **argv)
 
        /*
         * hack, did not find a cleaner solution.
-        * wait 2s to ensure that the status icon is attempted to be
+        * wait 30s to ensure that the status icon is attempted to be
         * drawn before determining whether the main window must be
         * show.
         */
-       g_timeout_add(2000, (GSourceFunc)initial_window_show, &ui);
+       if  (ui.config->hide_on_startup)
+               g_timeout_add(30000, (GSourceFunc)initial_window_show, &ui);
+       else
+               initial_window_show(&ui);
 
+       printf("main loop\n");
        /* main loop */
        gtk_main();