diff options
author | Ted Gould <ted@gould.cx> | 2010-01-12 13:37:40 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-01-12 13:37:40 -0600 |
commit | 9518459fda51ce675794115b401e36cb2f4306f5 (patch) | |
tree | e456c6ce6fa325a3738065675cfec584d75980b2 /src/libappindicator/app-indicator.c | |
parent | 7e5e095f25954857936213bd7136fb1e18583819 (diff) | |
download | libayatana-appindicator-9518459fda51ce675794115b401e36cb2f4306f5.tar.gz libayatana-appindicator-9518459fda51ce675794115b401e36cb2f4306f5.tar.bz2 libayatana-appindicator-9518459fda51ce675794115b401e36cb2f4306f5.zip |
Fallback timer pointer lifecycle.
Diffstat (limited to 'src/libappindicator/app-indicator.c')
-rw-r--r-- | src/libappindicator/app-indicator.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index b28a876..687ce21 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -66,7 +66,9 @@ struct _AppIndicatorPrivate { gchar * icon_path; DbusmenuServer *menuservice; GtkWidget *menu; + GtkStatusIcon * status_icon; + gint fallback_timer; /* Fun stuff */ DBusGProxy *watcher_proxy; @@ -116,6 +118,9 @@ enum { #define DEFAULT_ITEM_PATH "/org/ayatana/NotificationItem" #define DEFAULT_MENU_PATH "/org/ayatana/NotificationItem/Menu" +/* More constants */ +#define DEFAULT_FALLBACK_TIMER 100 /* in milliseconds */ + /* Boiler plate */ static void app_indicator_class_init (AppIndicatorClass *klass); static void app_indicator_init (AppIndicator *self); @@ -308,6 +313,7 @@ app_indicator_init (AppIndicator *self) priv->connection = NULL; priv->status_icon = NULL; + priv->fallback_timer = 0; /* Put the object on DBus */ GError * error = NULL; @@ -347,6 +353,11 @@ app_indicator_dispose (GObject *object) priv->status_icon = NULL; } + if (priv->fallback_timer != 0) { + g_source_remove(priv->fallback_timer); + priv->fallback_timer = 0; + } + if (priv->menu != NULL) { g_object_unref(G_OBJECT(priv->menu)); priv->menu = NULL; @@ -583,6 +594,9 @@ register_service_cb (DBusGProxy * proxy, GError * error, gpointer data) priv->watcher_proxy = NULL; start_fallback_timer(APP_INDICATOR(data), TRUE); } + + /* TODO: Unfallback here */ + return; } @@ -604,7 +618,13 @@ category_from_enum (AppIndicatorCategory category) static void start_fallback_timer (AppIndicator * self, gboolean do_it_now) { + AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self); + if (priv->fallback_timer != 0) { + /* The timer is set, let's just be happy with the one + we've already got running */ + return; + } } |