{
struct ui_psensor *ui;
+ log_printf(LOG_DEBUG, "initial_window_show()");
+
ui = (struct ui_psensor *)data;
log_printf(LOG_DEBUG,
- "is_status_supported: %d\n", is_status_supported());
+ "is_status_supported: %d", is_status_supported());
+ log_printf(LOG_DEBUG,
+ "is_appindicator_supported: %d", is_appindicator_supported());
+ log_printf(LOG_DEBUG,
+ "hide_on_startup: %d", ui->config->hide_on_startup);
if (!ui->config->hide_on_startup
|| (!is_appindicator_supported() && !is_status_supported()))
/* 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);
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 */
#include "ui.h"
#include "ui_appindicator.h"
#include "ui_sensorpref.h"
+#include "ui_status.h"
#include "ui_pref.h"
static GtkMenuItem **sensor_menu_items;
{
log_printf(LOG_DEBUG, "ui_appindicator#unity_fallback");
- gtk_widget_show_all(main_window);
-
appindicator_supported = 0;
- return NULL;
+ return ui_status_get_icon();
}
static void
* 02110-1301 USA
*/
-#include <gtk/gtk.h>
-
#include "log.h"
#include "ui_status.h"
void ui_status_init(struct ui_psensor *ui)
{
+ if (status)
+ return ;
+
log_printf(LOG_DEBUG, "ui_status_create()");
status = gtk_status_icon_new();
status_attention = attention;
}
+
+GtkStatusIcon *ui_status_get_icon()
+{
+ return status;
+}
#ifndef _PSENSOR_UI_STATUS_H_
#define _PSENSOR_UI_STATUS_H_
+#include <gtk/gtk.h>
#include <ui.h>
void ui_status_init(struct ui_psensor *ui);
void ui_status_update(struct ui_psensor *ui, unsigned int attention);
/* Whether status icon is supported i.e. visible. */
int is_status_supported();
+GtkStatusIcon *ui_status_get_icon();
#endif