X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fmain.c;h=2b2b5cae05325ecfd00916f0da68900c7d3dedd0;hb=05c414f8dd4ef338e7360c0bb0e8973f20da277e;hp=19a01e6f0c07db80ecc19d6c362699d64662d95d;hpb=de6a2cf11673ad8109b986e7cf24f626ad80df22;p=psensor.git diff --git a/src/main.c b/src/main.c index 19a01e6..2b2b5ca 100644 --- a/src/main.c +++ b/src/main.c @@ -134,7 +134,7 @@ static void log_measures(struct psensor **sensors) { if (log_level == LOG_DEBUG) while (*sensors) { - log_printf(LOG_DEBUG, "Measure: %s %.2f", + log_debug("Measure: %s %.2f", (*sensors)->name, psensor_get_current_value(*sensors)); @@ -355,10 +355,14 @@ static gboolean initial_window_show(gpointer data) { struct ui_psensor *ui; + log_debug("initial_window_show()"); + ui = (struct ui_psensor *)data; - log_printf(LOG_DEBUG, - "is_status_supported: %d\n", is_status_supported()); + log_debug("is_status_supported: %d", is_status_supported()); + log_debug("is_appindicator_supported: %d", + is_appindicator_supported()); + log_debug("hide_on_startup: %d", ui->config->hide_on_startup); if (!ui->config->hide_on_startup || (!is_appindicator_supported() && !is_status_supported())) @@ -470,14 +474,6 @@ int main(int argc, char **argv) /* sensor list */ ui_sensorlist_create(&ui); - /* - * show the window as soon as all gtk events have been processed - * in order to ensure that the status icon is attempted to be - * drawn before. If not, there is no way to detect that it is - * visible. - */ - g_idle_add((GSourceFunc)initial_window_show, &ui); - thread = g_thread_create((GThreadFunc) update_psensor_measures, &ui, TRUE, &error); @@ -492,6 +488,14 @@ int main(int argc, char **argv) ui_appindicator_init(&ui); #endif + /* + * show the window as soon as all gtk events have been processed + * in order to ensure that the status icon is attempted to be + * drawn before. If not, there is no way to detect that it is + * visible. + */ + g_idle_add((GSourceFunc)initial_window_show, &ui); + gdk_notify_startup_complete(); /* main loop */