From 2c5e030b8f4bca53a2db1994b4e468ad170385d0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Sat, 6 Oct 2012 10:11:32 +0000 Subject: [PATCH] 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. --- NEWS | 5 +++++ src/main.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f47075c..99f90ee 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,11 @@ ** 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 diff --git a/src/main.c b/src/main.c index 80e912e..4c16bf7 100644 --- a/src/main.c +++ b/src/main.c @@ -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(); -- 2.7.4