aboutsummaryrefslogtreecommitdiff
path: root/src/notifications-service.c
diff options
context:
space:
mode:
authorJason Conti <jason.conti@gmail.com>2011-05-13 18:16:54 -0400
committerJason Conti <jason.conti@gmail.com>2011-05-13 18:16:54 -0400
commitbdf9d9021867d8464ebfaa4c70350a25f1f496d4 (patch)
tree7a1331fe634f21f942df80f8c337f04cec77be0e /src/notifications-service.c
parent51bea07ada60838887f0555d5eef9fcf13613875 (diff)
downloadayatana-indicator-notifications-bdf9d9021867d8464ebfaa4c70350a25f1f496d4.tar.gz
ayatana-indicator-notifications-bdf9d9021867d8464ebfaa4c70350a25f1f496d4.tar.bz2
ayatana-indicator-notifications-bdf9d9021867d8464ebfaa4c70350a25f1f496d4.zip
Added add_message_item to the idle loop and it seems to be working much better now.
Diffstat (limited to 'src/notifications-service.c')
-rw-r--r--src/notifications-service.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/notifications-service.c b/src/notifications-service.c
index d69c848..a043cdd 100644
--- a/src/notifications-service.c
+++ b/src/notifications-service.c
@@ -49,7 +49,7 @@ static DbusmenuMenuitem *filter_item = NULL;
#define LOG_FILE_NAME "indicator-notifications-service.log"
static GOutputStream *log_file = NULL;
-static void add_message_item(Notification *);
+static gboolean add_message_item(gpointer);
static void build_menus(DbusmenuMenuitem *);
static void clear_notifications_cb(DbusmenuMenuitem *, guint, gpointer);
static void log_to_file_cb(GObject *, GAsyncResult *, gpointer);
@@ -57,9 +57,10 @@ static void log_to_file(const gchar *, GLogLevelFlags, const gchar *, gpointer);
static void message_received_cb(DBusSpy *, Notification *, gpointer);
static void service_shutdown_cb(IndicatorService *, gpointer);
-static void
-add_message_item(Notification *note)
+static gboolean
+add_message_item(gpointer user_data)
{
+ Notification *note = NOTIFICATION(user_data);
DbusmenuMenuitem *item;
GList *test;
@@ -69,6 +70,10 @@ add_message_item(Notification *note)
test = dbusmenu_menuitem_get_children(root);
g_debug("Children: %d", g_list_length(test));
+
+ g_object_unref(note);
+
+ return FALSE;
}
static void
@@ -155,7 +160,8 @@ static void
message_received_cb(DBusSpy *spy, Notification *note, gpointer user_data)
{
//g_debug("Message received from %s", notification_get_app_name(note));
- add_message_item(note);
+ g_object_ref(note);
+ g_idle_add(add_message_item, note);
}
/* Responds to the service object saying it's time to shutdown.