[notification-daemon] Use consistent indentation



commit 0ee730fbc37f149615fdaa13c3e624127147ab0b
Author: William Jon McCann <jmccann redhat com>
Date:   Sat Jan 16 15:43:32 2010 -0500

    Use consistent indentation

 src/capplet/notification-properties.c |  660 +++++++-------
 src/daemon/daemon.c                   | 1569 +++++++++++++++++----------------
 src/daemon/daemon.h                   |   58 +-
 src/daemon/engines.c                  |  356 +++++----
 src/daemon/engines.h                  |   52 +-
 src/daemon/stack.c                    |  382 +++++----
 src/daemon/stack.h                    |   25 +-
 src/themes/standard/theme.c           | 1534 +++++++++++++++++---------------
 8 files changed, 2413 insertions(+), 2223 deletions(-)
---
diff --git a/src/capplet/notification-properties.c b/src/capplet/notification-properties.c
index 29cc2b5..1b67c18 100644
--- a/src/capplet/notification-properties.c
+++ b/src/capplet/notification-properties.c
@@ -38,20 +38,19 @@
 
 typedef struct
 {
-        GladeXML    *xml;
-        GConfClient *client;
+        GladeXML           *xml;
+        GConfClient        *client;
 
-        GtkWidget   *dialog;
-        GtkWidget   *position_combo;
-        GtkWidget   *theme_combo;
-        GtkWidget   *preview_button;
+        GtkWidget          *dialog;
+        GtkWidget          *position_combo;
+        GtkWidget          *theme_combo;
+        GtkWidget          *preview_button;
 
         NotifyNotification *preview;
 
-        guint listeners[N_LISTENERS];
-        int   n_listeners;
-        int   expected_listeners;
-
+        guint               listeners[N_LISTENERS];
+        int                 n_listeners;
+        int                 expected_listeners;
 } NotificationAppletDialog;
 
 enum
@@ -71,458 +70,477 @@ enum
 
 const struct
 {
-        const gchar *identifier;
-        const gchar *label;
-
-} popup_stack_locations[] =
-{
-        { "top_left",     N_("Top Left")     },
-        { "top_right",    N_("Top Right")    },
-        { "bottom_left",  N_("Bottom Left")  },
-        { "bottom_right", N_("Bottom Right") }
+        const gchar    *identifier;
+        const gchar    *label;
+} popup_stack_locations[] = {
+        {"top_left", N_("Top Left")},
+        {"top_right", N_("Top Right")},
+        {"bottom_left", N_("Bottom Left")},
+        {"bottom_right", N_("Bottom Right")}
 };
 
 static void
-notification_properties_location_notify(GConfClient *client,
-                                        guint cnx_id,
-                                        GConfEntry *entry,
-                                        NotificationAppletDialog *dialog)
+notification_properties_location_notify (GConfClient              *client,
+                                         guint                     cnx_id,
+                                         GConfEntry               *entry,
+                                         NotificationAppletDialog *dialog)
 {
-        GtkTreeModel *model;
-        GtkTreeIter iter;
-        const char *location;
-        gboolean valid;
+        GtkTreeModel   *model;
+        GtkTreeIter     iter;
+        const char     *location;
+        gboolean        valid;
 
-        if (!entry->value || entry->value->type != GCONF_VALUE_STRING)
+        if (!entry->value
+            || entry->value->type != GCONF_VALUE_STRING)
                 return;
 
-        location = gconf_value_get_string(entry->value);
+        location = gconf_value_get_string (entry->value);
 
-        model = gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->position_combo));
-        valid = gtk_tree_model_get_iter_first(model, &iter);
+        model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->position_combo));
+        valid = gtk_tree_model_get_iter_first (model, &iter);
 
-        for (valid = gtk_tree_model_get_iter_first(model, &iter);
-                 valid;
-                 valid = gtk_tree_model_iter_next(model, &iter))
-        {
+        for (valid = gtk_tree_model_get_iter_first (model, &iter);
+             valid; valid = gtk_tree_model_iter_next (model, &iter)) {
                 gchar *key;
 
-                gtk_tree_model_get(model, &iter, NOTIFY_POSITION_NAME, &key, -1);
+                gtk_tree_model_get (model,
+                                    &iter,
+                                    NOTIFY_POSITION_NAME, &key,
+                                    -1);
 
-                if (g_str_equal(key, location))
-                {
-                        gtk_combo_box_set_active_iter(
-                                GTK_COMBO_BOX(dialog->position_combo),
-                                &iter);
-                        g_free(key);
+                if (g_str_equal (key, location)) {
+                        gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->position_combo),
+                                                       &iter);
+                        g_free (key);
                         break;
                 }
 
-                g_free(key);
+                g_free (key);
         }
 }
 
 static void
-notification_properties_location_changed(GtkComboBox *widget,
-                                         NotificationAppletDialog *dialog)
+notification_properties_location_changed (GtkComboBox              *widget,
+                                          NotificationAppletDialog *dialog)
 {
-        char *location;
-        GtkTreeModel *model;
-        GtkTreeIter iter;
+        char           *location;
+        GtkTreeModel   *model;
+        GtkTreeIter     iter;
 
-        model = gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->position_combo));
+        model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->position_combo));
 
-        if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dialog->position_combo),
-                                                                           &iter))
-        {
+        if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->position_combo), &iter)) {
                 return;
         }
 
-        gtk_tree_model_get(model, &iter, NOTIFY_POSITION_NAME, &location, -1);
+        gtk_tree_model_get (model,
+                            &iter,
+                            NOTIFY_POSITION_NAME, &location,
+                            -1);
 
-        gconf_client_set_string(dialog->client, GCONF_KEY_POPUP_LOCATION,
-                                                        location, NULL);
-        g_free(location);
+        gconf_client_set_string (dialog->client,
+                                 GCONF_KEY_POPUP_LOCATION,
+                                 location,
+                                 NULL);
+        g_free (location);
 }
 
 static void
-notification_properties_dialog_setup_positions(NotificationAppletDialog *dialog)
+notification_properties_dialog_setup_positions (NotificationAppletDialog *dialog)
 {
         NotifyStackLocation i;
-        char *location;
-        gboolean valid;
-        GtkListStore *store;
-        GtkTreeIter iter;
+        char               *location;
+        gboolean            valid;
+        GtkListStore       *store;
+        GtkTreeIter         iter;
 
-        dialog->position_combo =
-                glade_xml_get_widget(dialog->xml, "position_combo");
-        g_return_if_fail(dialog->position_combo != NULL);
+        dialog->position_combo = glade_xml_get_widget (dialog->xml,
+                                                       "position_combo");
+        g_return_if_fail (dialog->position_combo != NULL);
 
-        store = gtk_list_store_new(N_COLUMNS_POSITION,
-                                                           G_TYPE_STRING, G_TYPE_STRING);
+        store = gtk_list_store_new (N_COLUMNS_POSITION,
+                                    G_TYPE_STRING,
+                                    G_TYPE_STRING);
 
         for (i = NOTIFY_STACK_LOCATION_TOP_LEFT;
-                 i <= NOTIFY_STACK_LOCATION_BOTTOM_RIGHT;
-                 i++)
-        {
-                gtk_list_store_append(store, &iter);
-                gtk_list_store_set(store, &iter,
-                        NOTIFY_POSITION_LABEL, _(popup_stack_locations[i].label),
-                        NOTIFY_POSITION_NAME,  popup_stack_locations[i].identifier,
-                        -1);
+             i <= NOTIFY_STACK_LOCATION_BOTTOM_RIGHT;
+             i++) {
+                gtk_list_store_append (store, &iter);
+                gtk_list_store_set (store,
+                                    &iter,
+                                    NOTIFY_POSITION_LABEL, _(popup_stack_locations[i].label),
+                                    NOTIFY_POSITION_NAME, popup_stack_locations[i].identifier,
+                                    -1);
         }
 
-        gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->position_combo),
-                                                        GTK_TREE_MODEL(store));
-        g_signal_connect(dialog->position_combo, "changed",
-                                         G_CALLBACK(notification_properties_location_changed),
-                                         dialog);
+        gtk_combo_box_set_model (GTK_COMBO_BOX (dialog->position_combo),
+                                 GTK_TREE_MODEL (store));
+        g_signal_connect (dialog->position_combo,
+                          "changed",
+                          G_CALLBACK (notification_properties_location_changed),
+                          dialog);
 
-        location = gconf_client_get_string(dialog->client,
-                                                                           GCONF_KEY_POPUP_LOCATION, NULL);
+        location = gconf_client_get_string (dialog->client,
+                                            GCONF_KEY_POPUP_LOCATION,
+                                            NULL);
 
-        for (valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter);
-                 valid;
-                 valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter))
-        {
+        for (valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
+             valid;
+             valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter)) {
                 gchar *key;
 
-                gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
-                                                   NOTIFY_POSITION_NAME, &key,
-                                                   -1);
+                gtk_tree_model_get (GTK_TREE_MODEL (store),
+                                    &iter,
+                                    NOTIFY_POSITION_NAME, &key,
+                                    -1);
 
-                if (g_str_equal(key, location))
-                {
-                        gtk_combo_box_set_active_iter(
-                                GTK_COMBO_BOX(dialog->position_combo),
-                                &iter);
-                        g_free(key);
+                if (g_str_equal (key, location)) {
+                        gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->position_combo),
+                                                       &iter);
+                        g_free (key);
                         break;
                 }
 
-                g_free(key);
+                g_free (key);
         }
 
-        dialog->listeners[dialog->n_listeners] = gconf_client_notify_add(
-                dialog->client, GCONF_KEY_POPUP_LOCATION,
-                (GConfClientNotifyFunc)notification_properties_location_notify,
-                dialog, NULL, NULL);
+        dialog->listeners[dialog->n_listeners] =
+                gconf_client_notify_add (dialog->client,
+                                         GCONF_KEY_POPUP_LOCATION,
+                                         (GConfClientNotifyFunc) notification_properties_location_notify,
+                                         dialog,
+                                         NULL,
+                                         NULL);
         dialog->n_listeners++;
-        g_free(location);
+        g_free (location);
 }
 
 static void
-notification_properties_theme_notify(GConfClient *client,
-                                                                         guint cnx_id,
-                                                                         GConfEntry *entry,
-                                                                         NotificationAppletDialog *dialog)
+notification_properties_theme_notify (GConfClient              *client,
+                                      guint                     cnx_id,
+                                      GConfEntry               *entry,
+                                      NotificationAppletDialog *dialog)
 {
-        GtkTreeModel *model;
-        GtkTreeIter iter;
-        const char *theme;
-        gboolean valid;
+        GtkTreeModel   *model;
+        GtkTreeIter     iter;
+        const char     *theme;
+        gboolean        valid;
 
-        if (!entry->value || entry->value->type != GCONF_VALUE_STRING)
+        if (!entry->value
+            || entry->value->type != GCONF_VALUE_STRING)
                 return;
 
-        theme = gconf_value_get_string(entry->value);
+        theme = gconf_value_get_string (entry->value);
 
-        model = gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->theme_combo));
+        model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->theme_combo));
 
-        for (valid = gtk_tree_model_get_iter_first(model, &iter);
-                 valid;
-                 valid = gtk_tree_model_iter_next(model, &iter))
-        {
+        for (valid = gtk_tree_model_get_iter_first (model, &iter);
+             valid;
+             valid = gtk_tree_model_iter_next (model, &iter)) {
                 gchar *theme_name;
 
-                gtk_tree_model_get(model, &iter, NOTIFY_THEME_NAME, &theme_name, -1);
+                gtk_tree_model_get (model,
+                                    &iter,
+                                    NOTIFY_THEME_NAME, &theme_name,
+                                    -1);
 
-                if (g_str_equal(theme_name, theme))
-                {
-                        gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dialog->theme_combo),
-                                                                                  &iter);
-                        g_free(theme_name);
+                if (g_str_equal (theme_name, theme)) {
+                        gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->theme_combo),
+                                                       &iter);
+                        g_free (theme_name);
                         break;
                 }
 
-                g_free(theme_name);
+                g_free (theme_name);
         }
 }
 
 static void
-notification_properties_theme_changed(GtkComboBox *widget,
-                                                                          NotificationAppletDialog *dialog)
+notification_properties_theme_changed (GtkComboBox              *widget,
+                                       NotificationAppletDialog *dialog)
 {
-        char *theme;
-        GtkTreeModel *model;
-        GtkTreeIter iter;
+        char           *theme;
+        GtkTreeModel   *model;
+        GtkTreeIter     iter;
 
-        model = gtk_combo_box_get_model(GTK_COMBO_BOX(dialog->theme_combo));
+        model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->theme_combo));
 
-        if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(dialog->theme_combo),
-                                                                           &iter))
-        {
+        if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->theme_combo), &iter)) {
                 return;
         }
 
-        gtk_tree_model_get(model, &iter, NOTIFY_THEME_NAME, &theme, -1);
-        gconf_client_set_string(dialog->client, GCONF_KEY_THEME, theme, NULL);
-        g_free(theme);
+        gtk_tree_model_get (model, &iter, NOTIFY_THEME_NAME, &theme, -1);
+        gconf_client_set_string (dialog->client,
+                                 GCONF_KEY_THEME,
+                                 theme,
+                                 NULL);
+        g_free (theme);
 }
 
 static gchar *
-get_theme_name(const gchar *filename)
+get_theme_name (const gchar *filename)
 {
         gchar *result;
 
         /* TODO: Remove magic numbers. Strip "lib" and ".so" */
-        result = g_strdup(filename + 3);
-        result[strlen(result) - 3] = '\0';
+        result = g_strdup (filename + 3);
+        result[strlen (result) - 3] = '\0';
         return result;
 }
 
 static void
-notification_properties_dialog_setup_themes(NotificationAppletDialog *dialog)
+notification_properties_dialog_setup_themes (NotificationAppletDialog *dialog)
 {
-        GDir *dir;
-        const gchar *filename;
-        char *theme, *theme_name, *theme_label;
-        gboolean valid;
-        GtkListStore *store;
-        GtkTreeIter iter;
-
-        dialog->theme_combo = glade_xml_get_widget(dialog->xml, "theme_combo");
+        GDir           *dir;
+        const gchar    *filename;
+        char           *theme;
+        char           *theme_name;
+        char           *theme_label;
+        gboolean        valid;
+        GtkListStore   *store;
+        GtkTreeIter     iter;
+        GtkCellRenderer *cell ;
+
+        dialog->theme_combo = glade_xml_get_widget (dialog->xml, "theme_combo");
         g_assert (dialog->theme_combo != NULL);
 
-        store = gtk_list_store_new(N_COLUMNS_THEME,
-                                                           G_TYPE_STRING,
-                                                           G_TYPE_STRING,
-                                                           G_TYPE_STRING);
-
-        gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->theme_combo),
-                                                        GTK_TREE_MODEL(store));
-        g_signal_connect(dialog->theme_combo, "changed",
-                                         G_CALLBACK(notification_properties_theme_changed),
-                                         dialog);
-
-        GtkCellRenderer *cell = gtk_cell_renderer_text_new();
-        gtk_cell_layout_pack_start(
-                GTK_CELL_LAYOUT(GTK_COMBO_BOX(dialog->theme_combo)),
-                cell, TRUE);
-        gtk_cell_layout_set_attributes(
-                GTK_CELL_LAYOUT(GTK_COMBO_BOX(dialog->theme_combo)),
-                cell, "text", 0, NULL);
-
-        if ((dir = g_dir_open(ENGINES_DIR, 0, NULL)))
-        {
-                while ((filename = g_dir_read_name(dir)))
-                {
-                        if ( g_str_has_prefix(filename, "lib") &&
-                             g_str_has_suffix(filename, ".so") )
-                        {
-                                theme_name = get_theme_name(filename);
+        store = gtk_list_store_new (N_COLUMNS_THEME,
+                                    G_TYPE_STRING,
+                                    G_TYPE_STRING,
+                                    G_TYPE_STRING);
+
+        gtk_combo_box_set_model (GTK_COMBO_BOX (dialog->theme_combo),
+                                 GTK_TREE_MODEL (store));
+        g_signal_connect (dialog->theme_combo,
+                          "changed",
+                          G_CALLBACK (notification_properties_theme_changed),
+                          dialog);
+
+        cell = gtk_cell_renderer_text_new ();
+        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (GTK_COMBO_BOX (dialog->theme_combo)),
+                                    cell,
+                                    TRUE);
+        gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (GTK_COMBO_BOX (dialog->theme_combo)),
+                                        cell,
+                                        "text", 0,
+                                        NULL);
+
+        if ((dir = g_dir_open (ENGINES_DIR, 0, NULL))) {
+                while ((filename = g_dir_read_name (dir))) {
+                        if (g_str_has_prefix (filename, "lib")
+                            && g_str_has_suffix (filename, ".so")) {
+
+                                theme_name = get_theme_name (filename);
 
                                 /* FIXME: other solution than hardcode? */
-                                if (g_str_equal(theme_name, "slider"))
-                                        theme_label = g_strdup(_("Slider"));
-                                else if (g_str_equal(theme_name, "standard"))
-                                        theme_label = g_strdup(_("Standard theme"));
+                                if (g_str_equal (theme_name, "slider"))
+                                        theme_label = g_strdup (_("Slider"));
+                                else if (g_str_equal (theme_name, "standard"))
+                                        theme_label = g_strdup (_("Standard theme"));
                                 else
-                                        theme_label = g_strdup(theme_name);
-
-                                gtk_list_store_append(store, &iter);
-                                gtk_list_store_set(store, &iter,
-                                                                   NOTIFY_THEME_LABEL, theme_label,
-                                                                   NOTIFY_THEME_NAME, theme_name,
-                                                                   NOTIFY_THEME_FILENAME, filename,
-                                                                   -1);
-                                g_free(theme_name);
-                                g_free(theme_label);
+                                        theme_label = g_strdup (theme_name);
+
+                                gtk_list_store_append (store, &iter);
+                                gtk_list_store_set (store,
+                                                    &iter,
+                                                    NOTIFY_THEME_LABEL, theme_label,
+                                                    NOTIFY_THEME_NAME, theme_name,
+                                                    NOTIFY_THEME_FILENAME, filename,
+                                                    -1);
+                                g_free (theme_name);
+                                g_free (theme_label);
                         }
                 }
 
-                g_dir_close(dir);
-        }
-        else
-        {
-                g_warning("Error opening themes dir");
+                g_dir_close (dir);
+        } else {
+                g_warning ("Error opening themes dir");
         }
 
 
-        theme = gconf_client_get_string(dialog->client, GCONF_KEY_THEME, NULL);
+        theme = gconf_client_get_string (dialog->client,
+                                         GCONF_KEY_THEME,
+                                         NULL);
 
-        for (valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter);
-                 valid;
-                 valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter))
-        {
+        for (valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
+             valid;
+             valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter)) {
                 gchar *key;
 
-                gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
-                                                   NOTIFY_THEME_NAME, &key,
-                                                   -1);
+                gtk_tree_model_get (GTK_TREE_MODEL (store),
+                                    &iter,
+                                    NOTIFY_THEME_NAME, &key,
+                                    -1);
 
-                if (g_str_equal(key, theme))
-                {
-                        gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dialog->theme_combo),
-                                                                                  &iter);
-                        g_free(key);
+                if (g_str_equal (key, theme)) {
+                        gtk_combo_box_set_active_iter (GTK_COMBO_BOX (dialog->theme_combo),
+                                                       &iter);
+                        g_free (key);
                         break;
                 }
 
-                g_free(key);
+                g_free (key);
         }
 
         dialog->listeners[dialog->n_listeners] =
-                gconf_client_notify_add(dialog->client,
-                        GCONF_KEY_THEME,
-                        (GConfClientNotifyFunc)notification_properties_theme_notify,
-                        dialog, NULL, NULL);
+                gconf_client_notify_add (dialog->client,
+                                         GCONF_KEY_THEME,
+                                         (GConfClientNotifyFunc) notification_properties_theme_notify,
+                                         dialog,
+                                         NULL,
+                                         NULL);
         dialog->n_listeners++;
-        g_free(theme);
+        g_free (theme);
 }
 
 static void
-notification_properties_dialog_help(void)
+notification_properties_dialog_help (void)
 {
-  /* Do nothing */
+        /* Do nothing */
 }
 
 static void
-show_message(NotificationAppletDialog *dialog,
-                         const gchar *message)
+show_message (NotificationAppletDialog *dialog,
+              const gchar              *message)
 {
         GtkWidget *d;
 
-        d = gtk_message_dialog_new(GTK_WINDOW(dialog->dialog),
-                                                           GTK_DIALOG_DESTROY_WITH_PARENT,
-                                                           GTK_MESSAGE_ERROR,
-                                                           GTK_BUTTONS_CLOSE,
-                                                           "%s", message);
-        gtk_dialog_run(GTK_DIALOG(d));
-        gtk_widget_destroy(d);
+        d = gtk_message_dialog_new (GTK_WINDOW (dialog->dialog),
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_ERROR,
+                                    GTK_BUTTONS_CLOSE,
+                                    "%s",
+                                    message);
+        gtk_dialog_run (GTK_DIALOG (d));
+        gtk_widget_destroy (d);
 }
 
 static void
-notification_properties_dialog_preview_closed(NotifyNotification *preview,
-                                                                                          NotificationAppletDialog *dialog)
+notification_properties_dialog_preview_closed (NotifyNotification       *preview,
+                                               NotificationAppletDialog *dialog)
 {
         if (preview == dialog->preview)
                 dialog->preview = NULL;
 
-        g_object_unref(preview);
+        g_object_unref (preview);
 }
 
 static void
-notification_properties_dialog_preview(NotificationAppletDialog *dialog)
+notification_properties_dialog_preview (NotificationAppletDialog *dialog)
 {
         GError *error;
 
-        if (!notify_is_initted() && !notify_init("n-d"))
-        {
-                show_message(dialog, _("Error initializing libnotify"));
+        if (!notify_is_initted ()
+            && !notify_init ("n-d")) {
+                show_message (dialog, _("Error initializing libnotify"));
                 return;
         }
 
         error = NULL;
 
-        if (dialog->preview)
-        {
-                notify_notification_close(dialog->preview, NULL);
-                g_object_unref(dialog->preview);
+        if (dialog->preview) {
+                notify_notification_close (dialog->preview, NULL);
+                g_object_unref (dialog->preview);
                 dialog->preview = NULL;
         }
 
-        dialog->preview = notify_notification_new(_("Notification Test"),
-                                                                                          _("Just a test"),
-                                                                                          "gnome-util",
-                                                                                          NULL);
-
-        if (!notify_notification_show(dialog->preview, &error))
-        {
-                char *message = g_strdup_printf(
-                        _("Error while displaying notification: %s"), error->message);
-                show_message(dialog, message);
-                g_error_free(error);
-                g_free(message);
+        dialog->preview = notify_notification_new (_("Notification Test"),
+                                                   _("Just a test"),
+                                                   "gnome-util",
+                                                   NULL);
+
+        if (!notify_notification_show (dialog->preview, &error)) {
+                char *message;
+
+                message = g_strdup_printf (_("Error while displaying notification: %s"),
+                                           error->message);
+                show_message (dialog, message);
+                g_error_free (error);
+                g_free (message);
         }
 
-        g_signal_connect(dialog->preview, "closed",
-                                         G_CALLBACK(notification_properties_dialog_preview_closed),
-                                         dialog);
+        g_signal_connect (dialog->preview,
+                          "closed",
+                          G_CALLBACK (notification_properties_dialog_preview_closed),
+                          dialog);
 }
 
 static void
-notification_properties_dialog_response(GtkWidget *widget,
-                                                                                int response,
-                                                                                NotificationAppletDialog *dialog)
+notification_properties_dialog_response (GtkWidget                *widget,
+                                         int                       response,
+                                         NotificationAppletDialog *dialog)
 {
-        switch (response)
-        {
-                case GTK_RESPONSE_HELP:
-                        notification_properties_dialog_help();
-                        break;
-
-                case GTK_RESPONSE_ACCEPT:
-                        notification_properties_dialog_preview(dialog);
-                        break;
-
-                case GTK_RESPONSE_CLOSE:
-                default:
-                        gtk_widget_destroy(widget);
-                        break;
+        switch (response) {
+        case GTK_RESPONSE_HELP:
+                notification_properties_dialog_help ();
+                break;
+
+        case GTK_RESPONSE_ACCEPT:
+                notification_properties_dialog_preview (dialog);
+                break;
+
+        case GTK_RESPONSE_CLOSE:
+        default:
+                gtk_widget_destroy (widget);
+                break;
         }
 }
 
 static void
-notification_properties_dialog_destroyed(GtkWidget *widget,
-                                                                                 NotificationAppletDialog *dialog)
+notification_properties_dialog_destroyed (GtkWidget                *widget,
+                                          NotificationAppletDialog *dialog)
 {
         dialog->dialog = NULL;
 
-        gtk_main_quit();
+        gtk_main_quit ();
 }
 
 static gboolean
-notification_properties_dialog_init(NotificationAppletDialog *dialog)
+notification_properties_dialog_init (NotificationAppletDialog *dialog)
 {
 #define NOTIFICATION_GLADE_FILE "notification-properties.glade"
         const char *glade_file;
 
-        if (g_file_test(NOTIFICATION_GLADE_FILE, G_FILE_TEST_EXISTS))
+        if (g_file_test (NOTIFICATION_GLADE_FILE, G_FILE_TEST_EXISTS))
                 glade_file = NOTIFICATION_GLADE_FILE;
         else
                 glade_file = NOTIFICATION_GLADEDIR "/" NOTIFICATION_GLADE_FILE;
 
-        dialog->xml = glade_xml_new(glade_file, "dialog", NULL);
+        dialog->xml = glade_xml_new (glade_file, "dialog", NULL);
 
-        if (!dialog->xml)
-        {
-                g_warning(_("Unable to locate glade file '%s'"), glade_file);
+        if (!dialog->xml) {
+                g_warning (_("Unable to locate glade file '%s'"), glade_file);
                 return FALSE;
         }
 
-        dialog->dialog = glade_xml_get_widget(dialog->xml, "dialog");
-        g_assert(dialog->dialog != NULL);
-
-        g_signal_connect(dialog->dialog, "response",
-                                         G_CALLBACK(notification_properties_dialog_response),
-                                         dialog);
-        g_signal_connect(dialog->dialog, "destroy",
-                                         G_CALLBACK(notification_properties_dialog_destroyed),
-                                         dialog);
-
-        dialog->client = gconf_client_get_default();
-        gconf_client_add_dir(dialog->client, GCONF_KEY_DAEMON,
-                                                 GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+        dialog->dialog = glade_xml_get_widget (dialog->xml, "dialog");
+        g_assert (dialog->dialog != NULL);
+
+        g_signal_connect (dialog->dialog,
+                          "response",
+                          G_CALLBACK
+                          (notification_properties_dialog_response),
+                          dialog);
+        g_signal_connect (dialog->dialog,
+                          "destroy",
+                          G_CALLBACK
+                          (notification_properties_dialog_destroyed),
+                          dialog);
+
+        dialog->client = gconf_client_get_default ();
+        gconf_client_add_dir (dialog->client,
+                              GCONF_KEY_DAEMON,
+                              GCONF_CLIENT_PRELOAD_ONELEVEL,
+                              NULL);
 
         dialog->expected_listeners = N_LISTENERS;
-        dialog->n_listeners        = 0;
+        dialog->n_listeners = 0;
 
-        notification_properties_dialog_setup_themes(dialog);
-        notification_properties_dialog_setup_positions(dialog);
+        notification_properties_dialog_setup_themes (dialog);
+        notification_properties_dialog_setup_positions (dialog);
 
-        g_assert(dialog->n_listeners == dialog->expected_listeners);
-        gtk_widget_show(dialog->dialog);
+        g_assert (dialog->n_listeners == dialog->expected_listeners);
+        gtk_widget_show (dialog->dialog);
 
         dialog->preview = NULL;
 
@@ -532,68 +550,64 @@ notification_properties_dialog_init(NotificationAppletDialog *dialog)
 }
 
 static void
-notification_properties_dialog_finalize(NotificationAppletDialog *dialog)
+notification_properties_dialog_finalize (NotificationAppletDialog *dialog)
 {
-        if (dialog->dialog != NULL)
-        {
-                gtk_widget_destroy(dialog->dialog);
+        if (dialog->dialog != NULL) {
+                gtk_widget_destroy (dialog->dialog);
                 dialog->dialog = NULL;
         }
 
-        if (dialog->client != NULL)
-        {
+        if (dialog->client != NULL) {
                 int i;
-                for (i = 0; i < dialog->n_listeners; i++)
-                {
-                        if (dialog->listeners[i])
-                        {
-                                gconf_client_notify_remove(dialog->client,
-                                                                                   dialog->listeners[i]);
+
+                for (i = 0; i < dialog->n_listeners; i++) {
+                        if (dialog->listeners[i]) {
+                                gconf_client_notify_remove (dialog->client,
+                                                            dialog->listeners[i]);
                                 dialog->listeners[i] = 0;
                         }
                 }
 
                 dialog->n_listeners = 0;
-                gconf_client_remove_dir(dialog->client, GCONF_KEY_DAEMON, NULL);
-                g_object_unref(dialog->client);
+                gconf_client_remove_dir (dialog->client,
+                                         GCONF_KEY_DAEMON,
+                                         NULL);
+                g_object_unref (dialog->client);
                 dialog->client = NULL;
         }
 
-        if (dialog->xml != NULL)
-        {
-                g_object_unref(dialog->xml);
+        if (dialog->xml != NULL) {
+                g_object_unref (dialog->xml);
                 dialog->xml = NULL;
         }
 
-        if (dialog->preview)
-        {
-                notify_notification_close(dialog->preview, NULL);
+        if (dialog->preview) {
+                notify_notification_close (dialog->preview, NULL);
                 dialog->preview = NULL;
         }
 }
 
 int
-main(int argc, char **argv)
+main (int argc, char **argv)
 {
         NotificationAppletDialog dialog = { NULL, };
 
-        bindtextdomain(GETTEXT_PACKAGE, NOTIFICATION_LOCALEDIR);
-        bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
-        textdomain(GETTEXT_PACKAGE);
+        bindtextdomain (GETTEXT_PACKAGE, NOTIFICATION_LOCALEDIR);
+        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+        textdomain (GETTEXT_PACKAGE);
 
-        gtk_init(&argc, &argv);
+        gtk_init (&argc, &argv);
 
-        notify_init("notification-properties");
+        notify_init ("notification-properties");
 
-        if (!notification_properties_dialog_init(&dialog))
-        {
-                notification_properties_dialog_finalize(&dialog);
+        if (!notification_properties_dialog_init (&dialog)) {
+                notification_properties_dialog_finalize (&dialog);
                 return 1;
         }
 
-        gtk_main();
+        gtk_main ();
 
-        notification_properties_dialog_finalize(&dialog);
+        notification_properties_dialog_finalize (&dialog);
 
         return 0;
 }
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 2c0075e..a00f9fe 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -1,5 +1,4 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- * daemon.c - Implementation of the destop notification spec
  *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
  * Copyright (C) 2005 John (J5) Palmieri <johnp redhat com>
@@ -62,44 +61,43 @@
 typedef struct
 {
         NotifyStackLocation type;
-        const gchar *identifier;
+        const gchar    *identifier;
 
 } PopupNotifyStackLocation;
 
-const PopupNotifyStackLocation popup_stack_locations[] =
-{
-        { NOTIFY_STACK_LOCATION_TOP_LEFT,     "top_left"     },
-        { NOTIFY_STACK_LOCATION_TOP_RIGHT,    "top_right"    },
-        { NOTIFY_STACK_LOCATION_BOTTOM_LEFT,  "bottom_left"  },
-        { NOTIFY_STACK_LOCATION_BOTTOM_RIGHT, "bottom_right" },
-        { NOTIFY_STACK_LOCATION_UNKNOWN,      NULL }
+const PopupNotifyStackLocation popup_stack_locations[] = {
+        {NOTIFY_STACK_LOCATION_TOP_LEFT, "top_left"},
+        {NOTIFY_STACK_LOCATION_TOP_RIGHT, "top_right"},
+        {NOTIFY_STACK_LOCATION_BOTTOM_LEFT, "bottom_left"},
+        {NOTIFY_STACK_LOCATION_BOTTOM_RIGHT, "bottom_right"},
+        {NOTIFY_STACK_LOCATION_UNKNOWN, NULL}
 };
 
-#define POPUP_STACK_DEFAULT_INDEX 3 /* XXX Hack! */
+#define POPUP_STACK_DEFAULT_INDEX 3     /* XXX Hack! */
 
 typedef struct
 {
-        NotifyDaemon *daemon;
-        GTimeVal expiration;
-        GTimeVal paused_diff;
-        gboolean has_timeout;
-        gboolean paused;
-        guint id;
-        GtkWindow *nw;
-        Window src_window_xid;
+        NotifyDaemon   *daemon;
+        GTimeVal        expiration;
+        GTimeVal        paused_diff;
+        gboolean        has_timeout;
+        gboolean        paused;
+        guint           id;
+        GtkWindow      *nw;
+        Window          src_window_xid;
 } NotifyTimeout;
 
 struct _NotifyDaemonPrivate
 {
-        guint next_id;
-        guint timeout_source;
-        guint exit_timeout_source;
-        GHashTable *idle_reposition_notify_ids;
-        GHashTable *monitored_window_hash;
-        GHashTable *notification_hash;
-        gboolean url_clicked_lock;
-        NotifyStack **stacks;
-        gint stacks_size;
+        guint           next_id;
+        guint           timeout_source;
+        guint           exit_timeout_source;
+        GHashTable     *idle_reposition_notify_ids;
+        GHashTable     *monitored_window_hash;
+        GHashTable     *notification_hash;
+        gboolean        url_clicked_lock;
+        NotifyStack   **stacks;
+        gint            stacks_size;
 };
 
 static GConfClient *gconf_client = NULL;
@@ -110,88 +108,96 @@ static DBusConnection *dbus_conn = NULL;
          (DBUS_MAJOR_VER == (major) && DBUS_MINOR_VER >= (minor)))
 
 #if !CHECK_DBUS_VERSION(0, 60)
+
 /* This is a hack that will go away in time. For now, it's fairly safe. */
 struct _DBusGMethodInvocation
 {
-        DBusGConnection *connection;
-        DBusGMessage *message;
+        DBusGConnection       *connection;
+        DBusGMessage          *message;
         const DBusGObjectInfo *object;
         const DBusGMethodInfo *method;
 };
 #endif /* D-BUS < 0.60 */
 
-static void notify_daemon_finalize(GObject *object);
-static void _notification_destroyed_cb(GtkWindow *nw, NotifyDaemon *daemon);
-static void _close_notification(NotifyDaemon *daemon, guint id,
-                                gboolean hide_notification,
-                                NotifydClosedReason reason);
-static GdkFilterReturn _notify_x11_filter(GdkXEvent *xevent,
-                                          GdkEvent *event,
-                                          gpointer user_data);
-static void _emit_closed_signal(GtkWindow *nw, NotifydClosedReason reason);
-static void _action_invoked_cb(GtkWindow *nw, const char *key);
-static NotifyStackLocation get_stack_location_from_string(const char *slocation);
-static void sync_notification_position(NotifyDaemon *daemon, GtkWindow *nw,
-                                       Window source);
-static void monitor_notification_source_windows(NotifyDaemon *daemon,
-                                                NotifyTimeout *nt,
-                                                Window source);
-
-G_DEFINE_TYPE(NotifyDaemon, notify_daemon, G_TYPE_OBJECT);
+static void     notify_daemon_finalize (GObject * object);
+static void     _notification_destroyed_cb (GtkWindow * nw,
+                                            NotifyDaemon * daemon);
+static void     _close_notification (NotifyDaemon * daemon, guint id,
+                                     gboolean hide_notification,
+                                     NotifydClosedReason reason);
+static GdkFilterReturn _notify_x11_filter (GdkXEvent * xevent,
+                                           GdkEvent * event,
+                                           gpointer user_data);
+static void     _emit_closed_signal (GtkWindow * nw,
+                                     NotifydClosedReason reason);
+static void     _action_invoked_cb (GtkWindow * nw, const char *key);
+static NotifyStackLocation get_stack_location_from_string (const char
+                                                           *slocation);
+static void     sync_notification_position (NotifyDaemon * daemon,
+                                            GtkWindow * nw, Window source);
+static void     monitor_notification_source_windows (NotifyDaemon * daemon,
+                                                     NotifyTimeout * nt,
+                                                     Window source);
+
+G_DEFINE_TYPE (NotifyDaemon, notify_daemon, G_TYPE_OBJECT);
 
 static void
-notify_daemon_class_init(NotifyDaemonClass *daemon_class)
+notify_daemon_class_init (NotifyDaemonClass * daemon_class)
 {
-        GObjectClass *object_class = G_OBJECT_CLASS(daemon_class);
+        GObjectClass   *object_class = G_OBJECT_CLASS (daemon_class);
 
         object_class->finalize = notify_daemon_finalize;
 
-        g_type_class_add_private(daemon_class, sizeof(NotifyDaemonPrivate));
+        g_type_class_add_private (daemon_class, sizeof (NotifyDaemonPrivate));
 }
 
 static void
-_notify_timeout_destroy(NotifyTimeout *nt)
+_notify_timeout_destroy (NotifyTimeout * nt)
 {
         /*
          * Disconnect the destroy handler to avoid a loop since the id
          * won't be removed from the hash table before the widget is
          * destroyed.
          */
-        g_signal_handlers_disconnect_by_func(nt->nw, _notification_destroyed_cb,
-                                             nt->daemon);
+        g_signal_handlers_disconnect_by_func (nt->nw,
+                                              _notification_destroyed_cb,
+                                              nt->daemon);
 
-        gtk_widget_destroy(GTK_WIDGET(nt->nw));
-        g_free(nt);
+        gtk_widget_destroy (GTK_WIDGET (nt->nw));
+        g_free (nt);
 }
 
 static void
-reallocate_stacks (NotifyDaemon *daemon)
+reallocate_stacks (NotifyDaemon * daemon)
 {
-        GdkDisplay *display;
-        GdkScreen *screen;
-        gint old_stacks_size;
-        GConfClient *client = get_gconf_client();
+        GdkDisplay         *display;
+        GdkScreen          *screen;
+        gint                old_stacks_size;
+        GConfClient        *client = get_gconf_client ();
         NotifyStackLocation location;
-        gchar *slocation;
-        gint i;
+        gchar              *slocation;
+        gint                i;
 
-        display = gdk_display_get_default();
-        screen = gdk_display_get_default_screen(display);
+        display = gdk_display_get_default ();
+        screen = gdk_display_get_default_screen (display);
 
         if (daemon->priv->stacks_size < gdk_screen_get_n_monitors (screen)) {
-                slocation = gconf_client_get_string(client, GCONF_KEY_POPUP_LOCATION,
-                                                    NULL);
-                location = get_stack_location_from_string(slocation);
-                g_free(slocation);
+                slocation = gconf_client_get_string (client,
+                                                     GCONF_KEY_POPUP_LOCATION,
+                                                     NULL);
+                location = get_stack_location_from_string (slocation);
+                g_free (slocation);
 
                 old_stacks_size = daemon->priv->stacks_size;
-                daemon->priv->stacks_size = gdk_screen_get_n_monitors(screen);
-                daemon->priv->stacks = g_renew(NotifyStack *, daemon->priv->stacks, daemon->priv->stacks_size);
+                daemon->priv->stacks_size = gdk_screen_get_n_monitors (screen);
+                daemon->priv->stacks = g_renew (NotifyStack *,
+                                                daemon->priv->stacks,
+                                                daemon->priv->stacks_size);
                 for (i = old_stacks_size; i < daemon->priv->stacks_size; i++) {
-                        daemon->priv->stacks[i] = notify_stack_new(daemon,
-                                                                   screen,
-                                                                   i,
-                                                                   location);
+                        daemon->priv->stacks[i] = notify_stack_new (daemon,
+                                                                    screen,
+                                                                    i,
+                                                                    location);
                 }
         }
 }
@@ -205,7 +211,7 @@ do_exit (gpointer user_data)
 }
 
 static void
-add_exit_timeout (NotifyDaemon *daemon)
+add_exit_timeout (NotifyDaemon * daemon)
 {
         if (daemon->priv->exit_timeout_source > 0)
                 return;
@@ -213,7 +219,7 @@ add_exit_timeout (NotifyDaemon *daemon)
 }
 
 static void
-remove_exit_timeout (NotifyDaemon *daemon)
+remove_exit_timeout (NotifyDaemon * daemon)
 {
         if (daemon->priv->exit_timeout_source == 0)
                 return;
@@ -222,10 +228,10 @@ remove_exit_timeout (NotifyDaemon *daemon)
 }
 
 static void
-notify_daemon_init(NotifyDaemon *daemon)
+notify_daemon_init (NotifyDaemon * daemon)
 {
-        daemon->priv = G_TYPE_INSTANCE_GET_PRIVATE(daemon, NOTIFY_TYPE_DAEMON,
-                                                   NotifyDaemonPrivate);
+        daemon->priv = G_TYPE_INSTANCE_GET_PRIVATE (daemon, NOTIFY_TYPE_DAEMON,
+                                                    NotifyDaemonPrivate);
 
         daemon->priv->next_id = 1;
         daemon->priv->timeout_source = 0;
@@ -237,49 +243,46 @@ notify_daemon_init(NotifyDaemon *daemon)
 
         reallocate_stacks (daemon);
 
-        daemon->priv->idle_reposition_notify_ids = g_hash_table_new(NULL, NULL);
-        daemon->priv->monitored_window_hash = g_hash_table_new(NULL, NULL);
-        daemon->priv->notification_hash =
-                g_hash_table_new_full(g_int_hash, g_int_equal, g_free,
-                                      (GDestroyNotify)_notify_timeout_destroy);
+        daemon->priv->idle_reposition_notify_ids = g_hash_table_new (NULL, NULL);
+        daemon->priv->monitored_window_hash = g_hash_table_new (NULL, NULL);
+        daemon->priv->notification_hash = g_hash_table_new_full (g_int_hash, g_int_equal, g_free,
+                                                                 (GDestroyNotify)
+                                                                 _notify_timeout_destroy);
 }
 
 static void
-notify_daemon_finalize(GObject *object)
+notify_daemon_finalize (GObject * object)
 {
-        NotifyDaemon *daemon       = NOTIFY_DAEMON(object);
-        GObjectClass *parent_class = G_OBJECT_CLASS(notify_daemon_parent_class);
+        NotifyDaemon   *daemon = NOTIFY_DAEMON (object);
+        GObjectClass   *parent_class = G_OBJECT_CLASS (notify_daemon_parent_class);
 
-        if (g_hash_table_size(daemon->priv->monitored_window_hash) > 0)
-                gdk_window_remove_filter(NULL, _notify_x11_filter, daemon);
+        if (g_hash_table_size (daemon->priv->monitored_window_hash) > 0)
+                gdk_window_remove_filter (NULL, _notify_x11_filter, daemon);
 
         remove_exit_timeout (daemon);
 
-        g_hash_table_destroy(daemon->priv->monitored_window_hash);
-        g_hash_table_destroy(daemon->priv->idle_reposition_notify_ids);
-        g_hash_table_destroy(daemon->priv->notification_hash);
-        g_free(daemon->priv);
+        g_hash_table_destroy (daemon->priv->monitored_window_hash);
+        g_hash_table_destroy (daemon->priv->idle_reposition_notify_ids);
+        g_hash_table_destroy (daemon->priv->notification_hash);
+        g_free (daemon->priv);
 
         if (parent_class->finalize != NULL)
-                parent_class->finalize(object);
+                parent_class->finalize (object);
 }
 
 static NotifyStackLocation
-get_stack_location_from_string(const char *slocation)
+get_stack_location_from_string (const char *slocation)
 {
         NotifyStackLocation stack_location = NOTIFY_STACK_LOCATION_DEFAULT;
 
         if (slocation == NULL || *slocation == '\0')
                 return NOTIFY_STACK_LOCATION_DEFAULT;
-        else
-        {
+        else {
                 const PopupNotifyStackLocation *l;
 
                 for (l = popup_stack_locations;
-                     l->type != NOTIFY_STACK_LOCATION_UNKNOWN;
-                     l++)
-                {
-                        if (!strcmp(slocation, l->identifier))
+                     l->type != NOTIFY_STACK_LOCATION_UNKNOWN; l++) {
+                        if (!strcmp (slocation, l->identifier))
                                 stack_location = l->type;
                 }
         }
@@ -288,182 +291,191 @@ get_stack_location_from_string(const char *slocation)
 }
 
 static DBusMessage *
-create_signal(GtkWindow *nw, const char *signal_name)
+create_signal (GtkWindow * nw, const char *signal_name)
 {
-        guint id = NW_GET_NOTIFY_ID(nw);
-        gchar *dest = NW_GET_NOTIFY_SENDER(nw);
-        DBusMessage *message;
+        guint           id = NW_GET_NOTIFY_ID (nw);
+        gchar          *dest = NW_GET_NOTIFY_SENDER (nw);
+        DBusMessage    *message;
 
-        g_assert(dest != NULL);
+        g_assert (dest != NULL);
 
-        message = dbus_message_new_signal("/org/freedesktop/Notifications",
-                                          "org.freedesktop.Notifications",
-                                          signal_name);
+        message = dbus_message_new_signal ("/org/freedesktop/Notifications",
+                                           "org.freedesktop.Notifications",
+                                           signal_name);
 
-        dbus_message_set_destination(message, dest);
-        dbus_message_append_args(message,
-                                 DBUS_TYPE_UINT32, &id,
-                                 DBUS_TYPE_INVALID);
+        dbus_message_set_destination (message, dest);
+        dbus_message_append_args (message,
+                                  DBUS_TYPE_UINT32,
+                                  &id,
+                                  DBUS_TYPE_INVALID);
 
         return message;
 }
 
 static void
-_action_invoked_cb(GtkWindow *nw, const char *key)
+_action_invoked_cb (GtkWindow * nw, const char *key)
 {
-        NotifyDaemon *daemon = NW_GET_DAEMON(nw);
-        guint id = NW_GET_NOTIFY_ID(nw);
-        DBusMessage *message;
+        NotifyDaemon   *daemon = NW_GET_DAEMON (nw);
+        guint           id = NW_GET_NOTIFY_ID (nw);
+        DBusMessage    *message;
 
-        message = create_signal(nw, "ActionInvoked");
-        dbus_message_append_args(message,
-                                 DBUS_TYPE_STRING, &key,
-                                 DBUS_TYPE_INVALID);
+        message = create_signal (nw, "ActionInvoked");
+        dbus_message_append_args (message,
+                                  DBUS_TYPE_STRING,
+                                  &key,
+                                  DBUS_TYPE_INVALID);
 
-        dbus_connection_send(dbus_conn, message, NULL);
-        dbus_message_unref(message);
+        dbus_connection_send (dbus_conn, message, NULL);
+        dbus_message_unref (message);
 
-        _close_notification(daemon, id, TRUE, NOTIFYD_CLOSED_USER);
+        _close_notification (daemon, id, TRUE, NOTIFYD_CLOSED_USER);
 }
 
 static void
-_emit_closed_signal(GtkWindow *nw, NotifydClosedReason reason)
+_emit_closed_signal (GtkWindow * nw, NotifydClosedReason reason)
 {
-        DBusMessage *message = create_signal(nw, "NotificationClosed");
-        dbus_message_append_args(message,
-                                 DBUS_TYPE_UINT32, &reason,
-                                 DBUS_TYPE_INVALID);
-        dbus_connection_send(dbus_conn, message, NULL);
-        dbus_message_unref(message);
+        DBusMessage *message = create_signal (nw, "NotificationClosed");
+        dbus_message_append_args (message,
+                                  DBUS_TYPE_UINT32,
+                                  &reason,
+                                  DBUS_TYPE_INVALID);
+        dbus_connection_send (dbus_conn, message, NULL);
+        dbus_message_unref (message);
 }
 
 static void
-_close_notification(NotifyDaemon *daemon,
-                    guint id,
-                    gboolean hide_notification,
-                    NotifydClosedReason reason)
+_close_notification (NotifyDaemon       *daemon,
+                     guint               id,
+                     gboolean            hide_notification,
+                     NotifydClosedReason reason)
 {
         NotifyDaemonPrivate *priv = daemon->priv;
-        NotifyTimeout *nt;
+        NotifyTimeout       *nt;
 
-        nt = (NotifyTimeout *)g_hash_table_lookup(priv->notification_hash, &id);
+        nt = (NotifyTimeout *) g_hash_table_lookup (priv->notification_hash,
+                                                    &id);
 
-        if (nt != NULL)
-        {
-                _emit_closed_signal(nt->nw, reason);
+        if (nt != NULL) {
+                _emit_closed_signal (nt->nw, reason);
 
                 if (hide_notification)
-                        theme_hide_notification(nt->nw);
+                        theme_hide_notification (nt->nw);
 
-                g_hash_table_remove(priv->notification_hash, &id);
-                if (g_hash_table_size(daemon->priv->notification_hash) == 0)
+                g_hash_table_remove (priv->notification_hash, &id);
+                if (g_hash_table_size (daemon->priv->notification_hash) == 0)
                         add_exit_timeout (daemon);
         }
 }
 
 static void
-_notification_destroyed_cb(GtkWindow *nw, NotifyDaemon *daemon)
+_notification_destroyed_cb (GtkWindow * nw, NotifyDaemon * daemon)
 {
         /*
          * This usually won't happen, but can if notification-daemon dies before
          * all notifications are closed. Mark them as expired.
          */
-        _close_notification(daemon, NW_GET_NOTIFY_ID(nw), FALSE,
-                            NOTIFYD_CLOSED_EXPIRED);
+        _close_notification (daemon,
+                             NW_GET_NOTIFY_ID (nw),
+                             FALSE,
+                             NOTIFYD_CLOSED_EXPIRED);
 }
 
 typedef struct
 {
-        NotifyDaemon *daemon;
-        gint id;
+        NotifyDaemon   *daemon;
+        gint            id;
 } IdleRepositionData;
 
 static gboolean
-idle_reposition_notification(gpointer datap)
+idle_reposition_notification (gpointer datap)
 {
-        IdleRepositionData *data = (IdleRepositionData *)datap;
-        NotifyDaemon *daemon = data->daemon;
-        NotifyTimeout *nt;
-        gint notify_id;
+        IdleRepositionData *data = (IdleRepositionData *) datap;
+        NotifyDaemon   *daemon = data->daemon;
+        NotifyTimeout  *nt;
+        gint            notify_id;
 
         notify_id = data->id;
 
         /* Look up the timeout, if it's completed we don't need to do anything */
-        nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash,
-                                                  &notify_id);
+        nt = (NotifyTimeout *) g_hash_table_lookup (daemon->priv->notification_hash,
+                                                    &notify_id);
         if (nt != NULL) {
-                sync_notification_position(daemon, nt->nw, nt->src_window_xid);
+                sync_notification_position (daemon,
+                                            nt->nw,
+                                            nt->src_window_xid);
         }
 
-        g_hash_table_remove(daemon->priv->idle_reposition_notify_ids,
-                            GINT_TO_POINTER(notify_id));
-        g_object_unref(daemon);
-        g_free(data);
+        g_hash_table_remove (daemon->priv->idle_reposition_notify_ids,
+                             GINT_TO_POINTER (notify_id));
+        g_object_unref (daemon);
+        g_free (data);
 
         return FALSE;
 }
 
 static void
-_queue_idle_reposition_notification(NotifyDaemon *daemon, gint notify_id)
+_queue_idle_reposition_notification (NotifyDaemon * daemon, gint notify_id)
 {
         IdleRepositionData *data;
-        gpointer orig_key;
-        gpointer value;
-        guint idle_id;
+        gpointer        orig_key;
+        gpointer        value;
+        guint           idle_id;
 
         /* Do we already have an idle update pending? */
-        if (g_hash_table_lookup_extended(daemon->priv->idle_reposition_notify_ids,
-                                         GINT_TO_POINTER(notify_id),
-                                         &orig_key, &value))
-        {
+        if (g_hash_table_lookup_extended (daemon->priv->idle_reposition_notify_ids,
+                                          GINT_TO_POINTER (notify_id), &orig_key, &value)) {
                 return;
         }
 
-        data = g_new0(IdleRepositionData, 1);
-        data->daemon = g_object_ref(daemon);
+        data = g_new0 (IdleRepositionData, 1);
+        data->daemon = g_object_ref (daemon);
         data->id = notify_id;
 
         /* We do this as a short timeout to avoid repositioning spam */
-        idle_id = g_timeout_add_full(G_PRIORITY_LOW, 50,
-                                     idle_reposition_notification, data, NULL);
-        g_hash_table_insert(daemon->priv->idle_reposition_notify_ids,
-                            GINT_TO_POINTER(notify_id), GUINT_TO_POINTER(idle_id));
+        idle_id = g_timeout_add_full (G_PRIORITY_LOW,
+                                      50,
+                                      idle_reposition_notification,
+                                      data,
+                                      NULL);
+        g_hash_table_insert (daemon->priv->idle_reposition_notify_ids,
+                             GINT_TO_POINTER (notify_id),
+                             GUINT_TO_POINTER (idle_id));
 }
 
 static GdkFilterReturn
-_notify_x11_filter(GdkXEvent *xevent,
-                   GdkEvent *event,
-                   gpointer user_data)
+_notify_x11_filter (GdkXEvent *xevent,
+                    GdkEvent  *event,
+                    gpointer   user_data)
 {
-        NotifyDaemon *daemon = NOTIFY_DAEMON(user_data);
-        XEvent *xev = (XEvent *)xevent;
-        gpointer orig_key;
-        gpointer value;
-        gint notify_id;
-        NotifyTimeout *nt;
-
-        if (xev->xany.type == DestroyNotify)
-        {
-                g_hash_table_remove(daemon->priv->monitored_window_hash,
-                                    GUINT_TO_POINTER(xev->xany.window));
-                if (g_hash_table_size(daemon->priv->monitored_window_hash) == 0)
-                        gdk_window_remove_filter(NULL, _notify_x11_filter, daemon);
+        NotifyDaemon   *daemon = NOTIFY_DAEMON (user_data);
+        XEvent         *xev = (XEvent *) xevent;
+        gpointer        orig_key;
+        gpointer        value;
+        gint            notify_id;
+        NotifyTimeout  *nt;
+
+        if (xev->xany.type == DestroyNotify) {
+                g_hash_table_remove (daemon->priv->monitored_window_hash,
+                                     GUINT_TO_POINTER (xev->xany.window));
+                if (g_hash_table_size (daemon->priv->monitored_window_hash) == 0)
+                        gdk_window_remove_filter (NULL,
+                                                  _notify_x11_filter,
+                                                  daemon);
                 return GDK_FILTER_CONTINUE;
         }
 
-        if (!g_hash_table_lookup_extended(daemon->priv->monitored_window_hash,
-                                          GUINT_TO_POINTER(xev->xany.window), &orig_key, &value))
+        if (!g_hash_table_lookup_extended (daemon->priv->monitored_window_hash,
+                                           GUINT_TO_POINTER (xev->xany.window), &orig_key, &value))
                 return GDK_FILTER_CONTINUE;
 
-        notify_id = GPOINTER_TO_INT(value);
+        notify_id = GPOINTER_TO_INT (value);
 
-        if (xev->xany.type == ConfigureNotify || xev->xany.type == MapNotify)
-        {
-                _queue_idle_reposition_notification(daemon, notify_id);
-        }
-        else if (xev->xany.type == ReparentNotify)
-        {
-                nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash, &notify_id);
+        if (xev->xany.type == ConfigureNotify
+            || xev->xany.type == MapNotify) {
+                _queue_idle_reposition_notification (daemon, notify_id);
+        } else if (xev->xany.type == ReparentNotify) {
+                nt = (NotifyTimeout *) g_hash_table_lookup (daemon->priv->notification_hash,
+                                                            &notify_id);
 
                 if (nt == NULL)
                         return GDK_FILTER_CONTINUE;
@@ -472,98 +484,94 @@ _notify_x11_filter(GdkXEvent *xevent,
                  * If the window got reparented, we need to start monitoring the
                  * new parents.
                  */
-                monitor_notification_source_windows(daemon, nt, nt->src_window_xid);
-                sync_notification_position(daemon, nt->nw, nt->src_window_xid);
+                monitor_notification_source_windows (daemon,
+                                                     nt,
+                                                     nt->src_window_xid);
+                sync_notification_position (daemon,
+                                            nt->nw,
+                                            nt->src_window_xid);
         }
 
         return GDK_FILTER_CONTINUE;
 }
 
 static void
-_mouse_entered_cb(GtkWindow *nw,
-                  GdkEventCrossing *event,
-                  NotifyDaemon *daemon)
+_mouse_entered_cb (GtkWindow        *nw,
+                   GdkEventCrossing *event,
+                   NotifyDaemon     *daemon)
 {
-        NotifyTimeout *nt;
-        guint id;
-        GTimeVal now;
+        NotifyTimeout  *nt;
+        guint           id;
+        GTimeVal        now;
 
         if (event->detail == GDK_NOTIFY_INFERIOR)
                 return;
 
-        id = NW_GET_NOTIFY_ID(nw);
-        nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash,
-                                                  &id);
+        id = NW_GET_NOTIFY_ID (nw);
+        nt = (NotifyTimeout *) g_hash_table_lookup (daemon->priv->notification_hash, &id);
 
         nt->paused = TRUE;
-        g_get_current_time(&now);
+        g_get_current_time (&now);
 
         nt->paused_diff.tv_usec = nt->expiration.tv_usec - now.tv_usec;
-        nt->paused_diff.tv_sec  = nt->expiration.tv_sec  - now.tv_sec;
+        nt->paused_diff.tv_sec = nt->expiration.tv_sec - now.tv_sec;
 
-        if (nt->paused_diff.tv_usec < 0)
-        {
+        if (nt->paused_diff.tv_usec < 0) {
                 nt->paused_diff.tv_usec += G_USEC_PER_SEC;
                 nt->paused_diff.tv_sec--;
         }
 }
 
 static void
-_mouse_exitted_cb(GtkWindow *nw,
-                  GdkEventCrossing *event,
-                  NotifyDaemon *daemon)
+_mouse_exitted_cb (GtkWindow        *nw,
+                   GdkEventCrossing *event,
+                   NotifyDaemon     *daemon)
 {
-        NotifyTimeout *nt;
-        guint id;
+        NotifyTimeout  *nt;
+        guint           id;
 
         if (event->detail == GDK_NOTIFY_INFERIOR)
                 return;
 
-        id = NW_GET_NOTIFY_ID(nw);
-        nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash,
-                                                  &id);
+        id = NW_GET_NOTIFY_ID (nw);
+        nt = (NotifyTimeout *) g_hash_table_lookup (daemon->priv->notification_hash, &id);
 
         nt->paused = FALSE;
 }
 
 static gboolean
-_is_expired(gpointer key, gpointer value, gpointer data)
+_is_expired (gpointer key, gpointer value, gpointer data)
 {
-        NotifyTimeout *nt = (NotifyTimeout *)value;
-        gboolean *phas_more_timeouts = (gboolean *)data;
-        time_t now_time;
-        time_t expiration_time;
-        GTimeVal now;
+        NotifyTimeout  *nt = (NotifyTimeout *) value;
+        gboolean       *phas_more_timeouts = (gboolean *) data;
+        time_t          now_time;
+        time_t          expiration_time;
+        GTimeVal        now;
 
         if (!nt->has_timeout)
                 return FALSE;
 
-        g_get_current_time(&now);
+        g_get_current_time (&now);
 
-        expiration_time = (nt->expiration.tv_sec * 1000) +
-                          (nt->expiration.tv_usec / 1000);
+        expiration_time = (nt->expiration.tv_sec * 1000)
+                + (nt->expiration.tv_usec / 1000);
         now_time = (now.tv_sec * 1000) + (now.tv_usec / 1000);
 
-        if (now_time > expiration_time)
-        {
-                theme_notification_tick(nt->nw, 0);
-                _emit_closed_signal(nt->nw, NOTIFYD_CLOSED_EXPIRED);
+        if (now_time > expiration_time) {
+                theme_notification_tick (nt->nw, 0);
+                _emit_closed_signal (nt->nw, NOTIFYD_CLOSED_EXPIRED);
                 return TRUE;
-        }
-        else if (nt->paused)
-        {
-                nt->expiration.tv_usec = nt->paused_diff.tv_usec + now.tv_usec;
-                nt->expiration.tv_sec  = nt->paused_diff.tv_sec  + now.tv_sec;
+        } else if (nt->paused) {
+                nt->expiration.tv_usec =
+                        nt->paused_diff.tv_usec + now.tv_usec;
+                nt->expiration.tv_sec = nt->paused_diff.tv_sec + now.tv_sec;
 
-                if (nt->expiration.tv_usec >= G_USEC_PER_SEC)
-                {
+                if (nt->expiration.tv_usec >= G_USEC_PER_SEC) {
                         nt->expiration.tv_usec -= G_USEC_PER_SEC;
                         nt->expiration.tv_sec++;
                 }
-        }
-        else
-        {
-                theme_notification_tick(nt->nw, expiration_time - now_time);
+        } else {
+                theme_notification_tick (nt->nw, expiration_time - now_time);
         }
 
         *phas_more_timeouts = TRUE;
@@ -572,13 +580,14 @@ _is_expired(gpointer key, gpointer value, gpointer data)
 }
 
 static gboolean
-_check_expiration(gpointer data)
+_check_expiration (gpointer data)
 {
-        NotifyDaemon *daemon = (NotifyDaemon *)data;
-        gboolean has_more_timeouts = FALSE;
+        NotifyDaemon   *daemon = (NotifyDaemon *) data;
+        gboolean        has_more_timeouts = FALSE;
 
-        g_hash_table_foreach_remove(daemon->priv->notification_hash,
-                                    _is_expired, (gpointer)&has_more_timeouts);
+        g_hash_table_foreach_remove (daemon->priv->notification_hash,
+                                     _is_expired,
+                                     (gpointer) &has_more_timeouts);
 
         if (!has_more_timeouts) {
                 daemon->priv->timeout_source = 0;
@@ -589,20 +598,21 @@ _check_expiration(gpointer data)
 }
 
 static void
-_calculate_timeout(NotifyDaemon *daemon, NotifyTimeout *nt, int timeout)
+_calculate_timeout (NotifyDaemon  *daemon,
+                    NotifyTimeout *nt,
+                    int            timeout)
 {
         if (timeout == 0)
                 nt->has_timeout = FALSE;
-        else
-        {
-                glong usec;
+        else {
+                glong           usec;
 
                 nt->has_timeout = TRUE;
 
                 if (timeout == -1)
                         timeout = NOTIFY_DAEMON_DEFAULT_TIMEOUT;
 
-                theme_set_notification_timeout(nt->nw, timeout);
+                theme_set_notification_timeout (nt->nw, timeout);
 
                 usec = timeout * 1000;  /* convert from msec to usec */
 
@@ -614,26 +624,26 @@ _calculate_timeout(NotifyDaemon *daemon, NotifyTimeout *nt, int timeout)
                 if (usec < 0)
                         usec = G_MAXLONG;
 
-                g_get_current_time(&nt->expiration);
-                g_time_val_add(&nt->expiration, usec);
+                g_get_current_time (&nt->expiration);
+                g_time_val_add (&nt->expiration, usec);
 
-                if (daemon->priv->timeout_source == 0)
-                {
-                        daemon->priv->timeout_source =
-                                g_timeout_add(100, _check_expiration, daemon);
+                if (daemon->priv->timeout_source == 0) {
+                        daemon->priv->timeout_source = g_timeout_add (100, _check_expiration,
+                                                                      daemon);
                 }
         }
 }
 
 static NotifyTimeout *
-_store_notification(NotifyDaemon *daemon, GtkWindow *nw, int timeout)
+_store_notification (NotifyDaemon *daemon,
+                     GtkWindow    *nw,
+                     int           timeout)
 {
         NotifyDaemonPrivate *priv = daemon->priv;
-        NotifyTimeout *nt;
-        guint id = 0;
+        NotifyTimeout  *nt;
+        guint           id = 0;
 
-        do
-        {
+        do {
                 id = priv->next_id;
 
                 if (id != UINT_MAX)
@@ -641,367 +651,353 @@ _store_notification(NotifyDaemon *daemon, GtkWindow *nw, int timeout)
                 else
                         priv->next_id = 1;
 
-                if (g_hash_table_lookup(priv->notification_hash, &id) != NULL)
+                if (g_hash_table_lookup (priv->notification_hash, &id) != NULL)
                         id = 0;
 
         } while (id == 0);
 
-        nt = g_new0(NotifyTimeout, 1);
+        nt = g_new0 (NotifyTimeout, 1);
         nt->id = id;
         nt->nw = nw;
         nt->daemon = daemon;
 
-        _calculate_timeout(daemon, nt, timeout);
+        _calculate_timeout (daemon, nt, timeout);
 
-        g_hash_table_insert(priv->notification_hash,
-                            g_memdup(&id, sizeof(guint)), nt);
+        g_hash_table_insert (priv->notification_hash,
+                             g_memdup (&id, sizeof (guint)),
+                             nt);
         remove_exit_timeout (daemon);
 
         return nt;
 }
 
 static gboolean
-_notify_daemon_process_icon_data(NotifyDaemon *daemon,
-                                 GtkWindow *nw,
-                                 GValue *icon_data)
+_notify_daemon_process_icon_data (NotifyDaemon *daemon,
+                                  GtkWindow    *nw,
+                                  GValue       *icon_data)
 {
-        const guchar *data = NULL;
-        gboolean has_alpha;
-        int bits_per_sample;
-        int width;
-        int height;
-        int rowstride;
-        int n_channels;
-        gsize expected_len;
-        GdkPixbuf *pixbuf;
-        GValueArray *image_struct;
-        GValue *value;
-        GArray *tmp_array;
+        const guchar   *data = NULL;
+        gboolean        has_alpha;
+        int             bits_per_sample;
+        int             width;
+        int             height;
+        int             rowstride;
+        int             n_channels;
+        gsize           expected_len;
+        GdkPixbuf      *pixbuf;
+        GValueArray    *image_struct;
+        GValue         *value;
+        GArray         *tmp_array;
 #if CHECK_DBUS_VERSION(0, 61)
-        GType struct_type;
-
-        struct_type = dbus_g_type_get_struct("GValueArray",
-                                             G_TYPE_INT,
-                                             G_TYPE_INT,
-                                             G_TYPE_INT,
-                                             G_TYPE_BOOLEAN,
-                                             G_TYPE_INT,
-                                             G_TYPE_INT,
-                                             dbus_g_type_get_collection("GArray", G_TYPE_UCHAR),
-                                             G_TYPE_INVALID);
-
-        if (!G_VALUE_HOLDS(icon_data, struct_type))
-        {
-                g_warning("_notify_daemon_process_icon_data expected a "
-                          "GValue of type GValueArray");
+        GType           struct_type;
+
+        struct_type = dbus_g_type_get_struct ("GValueArray",
+                                              G_TYPE_INT,
+                                              G_TYPE_INT,
+                                              G_TYPE_INT,
+                                              G_TYPE_BOOLEAN,
+                                              G_TYPE_INT,
+                                              G_TYPE_INT,
+                                              dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR),
+                                              G_TYPE_INVALID);
+
+        if (!G_VALUE_HOLDS (icon_data, struct_type)) {
+                g_warning ("_notify_daemon_process_icon_data expected a "
+                           "GValue of type GValueArray");
                 return FALSE;
         }
 #endif /* D-BUS >= 0.61 */
 
-        image_struct = (GValueArray *)g_value_get_boxed(icon_data);
-        value = g_value_array_get_nth(image_struct, 0);
+        image_struct = (GValueArray *) g_value_get_boxed (icon_data);
+        value = g_value_array_get_nth (image_struct, 0);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected position "
-                          "0 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected position "
+                           "0 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value, G_TYPE_INT))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 0 of the GValueArray to be of type int");
+        if (!G_VALUE_HOLDS (value, G_TYPE_INT)) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 0 of the GValueArray to be of type int");
                 return FALSE;
         }
 
-        width = g_value_get_int(value);
-        value = g_value_array_get_nth(image_struct, 1);
+        width = g_value_get_int (value);
+        value = g_value_array_get_nth (image_struct, 1);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 1 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 1 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value, G_TYPE_INT))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 1 of the GValueArray to be of type int");
+        if (!G_VALUE_HOLDS (value, G_TYPE_INT)) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 1 of the GValueArray to be of type int");
                 return FALSE;
         }
 
-        height = g_value_get_int(value);
-        value = g_value_array_get_nth(image_struct, 2);
+        height = g_value_get_int (value);
+        value = g_value_array_get_nth (image_struct, 2);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 2 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 2 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value, G_TYPE_INT))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 2 of the GValueArray to be of type int");
+        if (!G_VALUE_HOLDS (value, G_TYPE_INT)) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 2 of the GValueArray to be of type int");
                 return FALSE;
         }
 
-        rowstride = g_value_get_int(value);
-        value = g_value_array_get_nth(image_struct, 3);
+        rowstride = g_value_get_int (value);
+        value = g_value_array_get_nth (image_struct, 3);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 3 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 3 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value, G_TYPE_BOOLEAN))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 3 of the GValueArray to be of type gboolean");
+        if (!G_VALUE_HOLDS (value, G_TYPE_BOOLEAN)) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 3 of the GValueArray to be of type gboolean");
                 return FALSE;
         }
 
-        has_alpha = g_value_get_boolean(value);
-        value = g_value_array_get_nth(image_struct, 4);
+        has_alpha = g_value_get_boolean (value);
+        value = g_value_array_get_nth (image_struct, 4);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 4 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 4 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value, G_TYPE_INT))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 4 of the GValueArray to be of type int");
+        if (!G_VALUE_HOLDS (value, G_TYPE_INT)) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 4 of the GValueArray to be of type int");
                 return FALSE;
         }
 
-        bits_per_sample = g_value_get_int(value);
-        value = g_value_array_get_nth(image_struct, 5);
+        bits_per_sample = g_value_get_int (value);
+        value = g_value_array_get_nth (image_struct, 5);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 5 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 5 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value, G_TYPE_INT))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 5 of the GValueArray to be of type int");
+        if (!G_VALUE_HOLDS (value, G_TYPE_INT)) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 5 of the GValueArray to be of type int");
                 return FALSE;
         }
 
-        n_channels = g_value_get_int(value);
-        value = g_value_array_get_nth(image_struct, 6);
+        n_channels = g_value_get_int (value);
+        value = g_value_array_get_nth (image_struct, 6);
 
-        if (value == NULL)
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 6 of the GValueArray to exist");
+        if (value == NULL) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 6 of the GValueArray to exist");
                 return FALSE;
         }
 
-        if (!G_VALUE_HOLDS(value,
-                           dbus_g_type_get_collection("GArray", G_TYPE_UCHAR)))
-        {
-                g_warning("_notify_daemon_process_icon_data expected "
-                          "position 6 of the GValueArray to be of type GArray");
+        if (!G_VALUE_HOLDS (value,
+                            dbus_g_type_get_collection ("GArray",
+                                                        G_TYPE_UCHAR))) {
+                g_warning ("_notify_daemon_process_icon_data expected "
+                           "position 6 of the GValueArray to be of type GArray");
                 return FALSE;
         }
 
-        tmp_array = (GArray *)g_value_get_boxed(value);
-        expected_len = (height - 1) * rowstride + width *
-                       ((n_channels * bits_per_sample + 7) / 8);
+        tmp_array = (GArray *) g_value_get_boxed (value);
+        expected_len = (height - 1) * rowstride + width
+                * ((n_channels * bits_per_sample + 7) / 8);
 
-        if (expected_len != tmp_array->len)
-        {
-                g_warning("_notify_daemon_process_icon_data expected image "
-                          "data to be of length %" G_GSIZE_FORMAT " but got a "
-                          "length of %u",
-                          expected_len, tmp_array->len);
+        if (expected_len != tmp_array->len) {
+                g_warning ("_notify_daemon_process_icon_data expected image "
+                           "data to be of length %" G_GSIZE_FORMAT
+                           " but got a " "length of %u", expected_len,
+                           tmp_array->len);
                 return FALSE;
         }
 
-        data = (guchar *)g_memdup(tmp_array->data, tmp_array->len);
-        pixbuf = gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, has_alpha,
-                                                                          bits_per_sample, width, height,
-                                                                          rowstride,
-                                                                          (GdkPixbufDestroyNotify)g_free,
-                                                                          NULL);
-        theme_set_notification_icon(nw, pixbuf);
-        g_object_unref(G_OBJECT(pixbuf));
+        data = (guchar *) g_memdup (tmp_array->data, tmp_array->len);
+        pixbuf = gdk_pixbuf_new_from_data (data,
+                                           GDK_COLORSPACE_RGB,
+                                           has_alpha,
+                                           bits_per_sample,
+                                           width,
+                                           height,
+                                           rowstride,
+                                           (GdkPixbufDestroyNotify) g_free,
+                                           NULL);
+        theme_set_notification_icon (nw, pixbuf);
+        g_object_unref (G_OBJECT (pixbuf));
 
         return TRUE;
 }
 
 static void
-window_clicked_cb(GtkWindow *nw, GdkEventButton *button, NotifyDaemon *daemon)
+window_clicked_cb (GtkWindow      *nw,
+                   GdkEventButton *button,
+                   NotifyDaemon   *daemon)
 {
-        if (daemon->priv->url_clicked_lock)
-        {
+        if (daemon->priv->url_clicked_lock) {
                 daemon->priv->url_clicked_lock = FALSE;
                 return;
         }
 
-        _action_invoked_cb(nw, "default");
-        _close_notification(daemon, NW_GET_NOTIFY_ID(nw), TRUE,
-                            NOTIFYD_CLOSED_USER);
+        _action_invoked_cb (nw, "default");
+        _close_notification (daemon,
+                             NW_GET_NOTIFY_ID (nw),
+                             TRUE,
+                             NOTIFYD_CLOSED_USER);
 }
 
 static void
-popup_location_changed_cb(GConfClient *client,
-                          guint cnxn_id,
-                          GConfEntry *entry,
-                          gpointer user_data)
+popup_location_changed_cb (GConfClient *client,
+                           guint        cnxn_id,
+                           GConfEntry  *entry,
+                           gpointer     user_data)
 {
-        NotifyDaemon *daemon = (NotifyDaemon*)user_data;
+        NotifyDaemon   *daemon = (NotifyDaemon *) user_data;
         NotifyStackLocation stack_location;
-        const char *slocation;
-        GConfValue *value;
-        gint i;
+        const char     *slocation;
+        GConfValue     *value;
+        gint            i;
 
         if (daemon == NULL)
                 return;
 
-        value = gconf_entry_get_value(entry);
-        slocation = (value != NULL ? gconf_value_get_string(value) : NULL);
+        value = gconf_entry_get_value (entry);
+        slocation = (value != NULL ? gconf_value_get_string (value) : NULL);
 
-        if (slocation != NULL && *slocation != '\0')
-        {
-                stack_location = get_stack_location_from_string(slocation);
-        }
-        else
-        {
-                gconf_client_set_string(get_gconf_client(),
-                                        "/apps/notification-daemon/popup_location",
-                                        popup_stack_locations[POPUP_STACK_DEFAULT_INDEX].identifier,
-                                        NULL);
+        if (slocation != NULL && *slocation != '\0') {
+                stack_location = get_stack_location_from_string (slocation);
+        } else {
+                gconf_client_set_string (get_gconf_client (),
+                                         "/apps/notification-daemon/popup_location",
+                                         popup_stack_locations
+                                         [POPUP_STACK_DEFAULT_INDEX].
+                                         identifier,
+                                         NULL);
 
                 stack_location = NOTIFY_STACK_LOCATION_DEFAULT;
         }
 
         for (i = 0; i < daemon->priv->stacks_size; i++)
-                notify_stack_set_location(daemon->priv->stacks[i], stack_location);
+                notify_stack_set_location (daemon->priv->stacks[i],
+                                           stack_location);
 }
 
 static void
-url_clicked_cb(GtkWindow *nw, const char *url)
+url_clicked_cb (GtkWindow * nw, const char *url)
 {
-        NotifyDaemon *daemon = NW_GET_DAEMON(nw);
-        char *escaped_url;
-        char *cmd = NULL;
+        NotifyDaemon   *daemon = NW_GET_DAEMON (nw);
+        char           *escaped_url;
+        char           *cmd = NULL;
 
         /* Somewhat of a hack.. */
         daemon->priv->url_clicked_lock = TRUE;
 
-        escaped_url = g_shell_quote(url);
+        escaped_url = g_shell_quote (url);
 
-        if (g_find_program_in_path("gvfs-open") != NULL)
-        {
-                cmd = g_strdup_printf("gvfs-open %s", escaped_url);
-        }
-        else if (g_find_program_in_path("xdg-open") != NULL)
-        {
-                cmd = g_strdup_printf("xdg-open %s", escaped_url);
-        }
-        else if (g_find_program_in_path("firefox") != NULL)
-        {
-                cmd = g_strdup_printf("firefox %s", escaped_url);
-        }
-        else
-        {
-                g_warning("Unable to find a browser.");
+        if (g_find_program_in_path ("gvfs-open") != NULL) {
+                cmd = g_strdup_printf ("gvfs-open %s", escaped_url);
+        } else if (g_find_program_in_path ("xdg-open") != NULL) {
+                cmd = g_strdup_printf ("xdg-open %s", escaped_url);
+        } else if (g_find_program_in_path ("firefox") != NULL) {
+                cmd = g_strdup_printf ("firefox %s", escaped_url);
+        } else {
+                g_warning ("Unable to find a browser.");
         }
 
-        g_free(escaped_url);
+        g_free (escaped_url);
 
-        if (cmd != NULL)
-        {
-                g_spawn_command_line_async(cmd, NULL);
-                g_free(cmd);
+        if (cmd != NULL) {
+                g_spawn_command_line_async (cmd, NULL);
+                g_free (cmd);
         }
 }
 
 static gboolean
-screensaver_active(GtkWidget *nw)
+screensaver_active (GtkWidget *nw)
 {
         DBusGConnection *connection;
-        DBusGProxy *gs_proxy;
-        GError *error;
-        gboolean active;
+        DBusGProxy      *gs_proxy;
+        GError          *error;
+        gboolean         active;
 
         active = FALSE;
 
         error = NULL;
-        connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
-        if (connection == NULL)
-        {
-                g_warning ("Failed to get dbus connection: %s", error->message);
-                g_error_free(error);
+        connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+        if (connection == NULL) {
+                g_warning ("Failed to get dbus connection: %s",
+                           error->message);
+                g_error_free (error);
                 goto out;
 
         }
-        gs_proxy = dbus_g_proxy_new_for_name(connection,
-                                             "org.gnome.ScreenSaver",
-                                             "/",
-                                             "org.gnome.ScreenSaver");
-
-        if (!dbus_g_proxy_call(gs_proxy, "GetActive", &error,
-                               G_TYPE_INVALID,
-                               G_TYPE_BOOLEAN, &active,
-                               G_TYPE_INVALID))
-        {
-                g_warning("Failed to call gnome-screensaver: %s", error->message);
-                g_error_free(error);
+        gs_proxy = dbus_g_proxy_new_for_name (connection,
+                                              "org.gnome.ScreenSaver",
+                                              "/",
+                                              "org.gnome.ScreenSaver");
+
+        if (!dbus_g_proxy_call (gs_proxy,
+                                "GetActive",
+                                &error,
+                                G_TYPE_INVALID,
+                                G_TYPE_BOOLEAN,
+                                &active,
+                                G_TYPE_INVALID)) {
+                g_warning ("Failed to call gnome-screensaver: %s",
+                           error->message);
+                g_error_free (error);
         }
-       g_object_unref (gs_proxy);
-out:
+        g_object_unref (gs_proxy);
+      out:
 
         return active;
 }
 
 static gboolean
-fullscreen_window_exists(GtkWidget *nw)
+fullscreen_window_exists (GtkWidget * nw)
 {
-        WnckScreen *wnck_screen;
-        WnckWorkspace *wnck_workspace;
-        GList *l;
+        WnckScreen     *wnck_screen;
+        WnckWorkspace  *wnck_workspace;
+        GList          *l;
 
-        wnck_screen = wnck_screen_get(GDK_SCREEN_XNUMBER(
-                gdk_drawable_get_screen(GDK_DRAWABLE(GTK_WIDGET(nw)->window))));
-        wnck_screen_force_update(wnck_screen);
+        wnck_screen = wnck_screen_get (GDK_SCREEN_XNUMBER
+                                       (gdk_drawable_get_screen (GDK_DRAWABLE (GTK_WIDGET (nw)->window))));
+        wnck_screen_force_update (wnck_screen);
 
-        wnck_workspace = wnck_screen_get_active_workspace(wnck_screen);
+        wnck_workspace = wnck_screen_get_active_workspace (wnck_screen);
 
-        for (l = wnck_screen_get_windows_stacked(wnck_screen);
+        for (l = wnck_screen_get_windows_stacked (wnck_screen);
              l != NULL;
-             l = l->next)
-        {
-                WnckWindow *wnck_win = (WnckWindow *)l->data;
-
-                if (wnck_window_is_on_workspace(wnck_win, wnck_workspace) &&
-                    wnck_window_is_fullscreen(wnck_win) &&
-                    wnck_window_is_active(wnck_win))
-                {
+             l = l->next) {
+                WnckWindow *wnck_win = (WnckWindow *) l->data;
+
+                if (wnck_window_is_on_workspace (wnck_win, wnck_workspace)
+                    && wnck_window_is_fullscreen (wnck_win)
+                    && wnck_window_is_active (wnck_win)) {
                         /*
                          * Sanity check if the window is _really_ fullscreen to
                          * work around a bug in libwnck that doesn't get all
                          * unfullscreen events.
                          */
-                        int sw = wnck_screen_get_width(wnck_screen);
-                        int sh = wnck_screen_get_height(wnck_screen);
+                        int sw = wnck_screen_get_width (wnck_screen);
+                        int sh = wnck_screen_get_height (wnck_screen);
                         int x, y, w, h;
 
-                        wnck_window_get_geometry(wnck_win, &x, &y, &w, &h);
+                        wnck_window_get_geometry (wnck_win, &x, &y, &w, &h);
 
                         if (sw == w && sh == h)
                                 return TRUE;
@@ -1012,22 +1008,25 @@ fullscreen_window_exists(GtkWidget *nw)
 }
 
 static Window
-get_window_parent(Display *display,
-                  Window window,
-                  Window *root)
+get_window_parent (Display * display, Window window, Window * root)
 {
-        Window parent;
-        Window *children = NULL;
-        guint nchildren;
-        gboolean result;
-
-        gdk_error_trap_push();
-        result = XQueryTree(display, window, root, &parent, &children, &nchildren);
-        if (gdk_error_trap_pop() || !result)
+        Window          parent;
+        Window         *children = NULL;
+        guint           nchildren;
+        gboolean        result;
+
+        gdk_error_trap_push ();
+        result = XQueryTree (display,
+                             window,
+                             root,
+                             &parent,
+                             &children,
+                             &nchildren);
+        if (gdk_error_trap_pop () || !result)
                 return None;
 
         if (children)
-                XFree(children);
+                XFree (children);
 
         return parent;
 }
@@ -1037,53 +1036,61 @@ get_window_parent(Display *display,
  * for position changes.
  */
 static void
-monitor_notification_source_windows(NotifyDaemon *daemon,
-                                    NotifyTimeout *nt,
-                                    Window source)
+monitor_notification_source_windows (NotifyDaemon * daemon,
+                                     NotifyTimeout * nt, Window source)
 {
-        Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
-        Window root = None;
-        Window parent;
+        Display        *display =
+                GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+        Window          root = None;
+        Window          parent;
 
         /* Start monitoring events if necessary.  We don't want to
            filter events unless we absolutely have to. */
-        if (g_hash_table_size(daemon->priv->monitored_window_hash) == 0)
-                gdk_window_add_filter(NULL, _notify_x11_filter, daemon);
+        if (g_hash_table_size (daemon->priv->monitored_window_hash) == 0)
+                gdk_window_add_filter (NULL, _notify_x11_filter, daemon);
 
         /* Store the window in the timeout */
-        g_assert(nt != NULL);
+        g_assert (nt != NULL);
         nt->src_window_xid = source;
 
-        for (parent = get_window_parent(display, source, &root);
-                 parent != None && root != parent;
-                 parent = get_window_parent(display, parent, &root)) {
+        for (parent = get_window_parent (display, source, &root);
+             parent != None && root != parent;
+             parent = get_window_parent (display, parent, &root)) {
 
-                XSelectInput(display, parent, StructureNotifyMask);
-                g_hash_table_insert(daemon->priv->monitored_window_hash,
-                                                        GUINT_TO_POINTER(parent), GINT_TO_POINTER(nt->id));
+                XSelectInput (display, parent, StructureNotifyMask);
+                g_hash_table_insert (daemon->priv->monitored_window_hash,
+                                     GUINT_TO_POINTER (parent),
+                                     GINT_TO_POINTER (nt->id));
         }
 }
 
 /* Use a source X Window ID to reposition a notification. */
 static void
-sync_notification_position(NotifyDaemon *daemon,
-                           GtkWindow *nw,
-                           Window source)
+sync_notification_position (NotifyDaemon *daemon,
+                            GtkWindow    *nw,
+                            Window        source)
 {
-        Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
-        Status result;
-        Window root;
-        Window child;
-        int x, y;
-        unsigned int width, height;
-        unsigned int border_width, depth;
+        Display        *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
+        Status          result;
+        Window          root;
+        Window          child;
+        int             x, y;
+        unsigned int    width, height;
+        unsigned int    border_width, depth;
 
-        gdk_error_trap_push();
+        gdk_error_trap_push ();
 
         /* Get the root for this window */
-        result = XGetGeometry(display, source, &root, &x, &y,
-                              &width, &height, &border_width, &depth);
-        if (gdk_error_trap_pop() || !result)
+        result = XGetGeometry (display,
+                               source,
+                               &root,
+                               &x,
+                               &y,
+                               &width,
+                               &height,
+                               &border_width,
+                               &depth);
+        if (gdk_error_trap_pop () || !result)
                 return;
 
         /*
@@ -1091,17 +1098,23 @@ sync_notification_position(NotifyDaemon *daemon,
          * the root.
          */
         gdk_error_trap_push ();
-        result = XTranslateCoordinates(display, source, root, 0, 0,
-                                       &x, &y, &child);
-        if (gdk_error_trap_pop() || !result)
+        result = XTranslateCoordinates (display,
+                                        source,
+                                        root,
+                                        0,
+                                        0,
+                                        &x,
+                                        &y,
+                                        &child);
+        if (gdk_error_trap_pop () || !result)
                 return;
 
-        x += width  / 2;
+        x += width / 2;
         y += height / 2;
 
-        theme_set_notification_arrow(nw, TRUE, x, y);
-        theme_move_notification(nw, x, y);
-        theme_show_notification(nw);
+        theme_set_notification_arrow (nw, TRUE, x, y);
+        theme_move_notification (nw, x, y);
+        theme_show_notification (nw);
 
         /*
          * We need to manually queue a draw here as the default theme recalculates
@@ -1109,51 +1122,51 @@ sync_notification_position(NotifyDaemon *daemon,
          * fairly broken), so just calling move/show above isn't enough to cause
          * its position to be calculated.
          */
-        gtk_widget_queue_draw(GTK_WIDGET(nw));
+        gtk_widget_queue_draw (GTK_WIDGET (nw));
 }
 
 GQuark
-notify_daemon_error_quark(void)
+notify_daemon_error_quark (void)
 {
-        static GQuark q = 0;
+        static GQuark   q = 0;
 
         if (q == 0)
-                q = g_quark_from_static_string("notification-daemon-error-quark");
+                q = g_quark_from_static_string
+                        ("notification-daemon-error-quark");
 
         return q;
 }
 
 gboolean
-notify_daemon_notify_handler(NotifyDaemon *daemon,
-                             const gchar *app_name,
-                             guint id,
-                             const gchar *icon,
-                             const gchar *summary,
-                             const gchar *body,
-                             gchar **actions,
-                             GHashTable *hints,
-                             int timeout,
-                             DBusGMethodInvocation *context)
+notify_daemon_notify_handler (NotifyDaemon *daemon,
+                              const gchar  *app_name,
+                              guint         id,
+                              const gchar  *icon,
+                              const gchar  *summary,
+                              const gchar  *body,
+                              gchar       **actions,
+                              GHashTable   *hints,
+                              int           timeout,
+                              DBusGMethodInvocation *context)
 {
         NotifyDaemonPrivate *priv = daemon->priv;
-        NotifyTimeout *nt = NULL;
-        GtkWindow *nw = NULL;
-        GValue *data;
-        gboolean use_pos_data = FALSE;
-        gboolean new_notification = FALSE;
-        gint x = 0;
-        gint y = 0;
-        Window window_xid = None;
-        guint return_id;
-        gchar *sender;
-        gchar *sound_file = NULL;
-        gboolean sound_enabled;
-        gint i;
-
-        if (id > 0)
-        {
-                nt = (NotifyTimeout *)g_hash_table_lookup(priv->notification_hash,
-                                                                                                  &id);
+        NotifyTimeout  *nt = NULL;
+        GtkWindow      *nw = NULL;
+        GValue         *data;
+        gboolean        use_pos_data = FALSE;
+        gboolean        new_notification = FALSE;
+        gint            x = 0;
+        gint            y = 0;
+        Window          window_xid = None;
+        guint           return_id;
+        gchar          *sender;
+        gchar          *sound_file = NULL;
+        gboolean        sound_enabled;
+        gint            i;
+
+        if (id > 0) {
+                nt = (NotifyTimeout *) g_hash_table_lookup (priv->notification_hash,
+                                                            &id);
 
                 if (nt != NULL)
                         nw = nt->nw;
@@ -1161,206 +1174,198 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
                         id = 0;
         }
 
-        if (nw == NULL)
-        {
-                nw = theme_create_notification(url_clicked_cb);
-                g_object_set_data(G_OBJECT(nw), "_notify_daemon", daemon);
-                gtk_widget_realize(GTK_WIDGET(nw));
+        if (nw == NULL) {
+                nw = theme_create_notification (url_clicked_cb);
+                g_object_set_data (G_OBJECT (nw), "_notify_daemon", daemon);
+                gtk_widget_realize (GTK_WIDGET (nw));
                 new_notification = TRUE;
 
-                g_signal_connect(G_OBJECT(nw), "button-release-event",
-                                 G_CALLBACK(window_clicked_cb), daemon);
-                g_signal_connect(G_OBJECT(nw), "destroy",
-                                 G_CALLBACK(_notification_destroyed_cb), daemon);
-                g_signal_connect(G_OBJECT(nw), "enter-notify-event",
-                                 G_CALLBACK(_mouse_entered_cb), daemon);
-                g_signal_connect(G_OBJECT(nw), "leave-notify-event",
-                                 G_CALLBACK(_mouse_exitted_cb), daemon);
-        }
-        else
-        {
-                theme_clear_notification_actions(nw);
+                g_signal_connect (G_OBJECT (nw),
+                                  "button-release-event",
+                                  G_CALLBACK (window_clicked_cb),
+                                  daemon);
+                g_signal_connect (G_OBJECT (nw),
+                                  "destroy",
+                                  G_CALLBACK (_notification_destroyed_cb),
+                                  daemon);
+                g_signal_connect (G_OBJECT (nw),
+                                  "enter-notify-event",
+                                  G_CALLBACK (_mouse_entered_cb),
+                                  daemon);
+                g_signal_connect (G_OBJECT (nw),
+                                  "leave-notify-event",
+                                  G_CALLBACK (_mouse_exitted_cb),
+                                  daemon);
+        } else {
+                theme_clear_notification_actions (nw);
         }
 
-        theme_set_notification_text(nw, summary, body);
-        theme_set_notification_hints(nw, hints);
+        theme_set_notification_text (nw, summary, body);
+        theme_set_notification_hints (nw, hints);
 
         /*
          *XXX This needs to handle file URIs and all that.
          */
 
 
-        if ((data = (GValue *)g_hash_table_lookup(hints, "window-xid")) != NULL)
-        {
-                window_xid = (Window)g_value_get_uint(data);
+        if ((data = (GValue *) g_hash_table_lookup (hints, "window-xid")) != NULL) {
+                window_xid = (Window) g_value_get_uint (data);
         }
         /* deal with x, and y hints */
-        else if ((data = (GValue *)g_hash_table_lookup(hints, "x")) != NULL)
-        {
-                x = g_value_get_int(data);
+        else if ((data = (GValue *) g_hash_table_lookup (hints, "x")) != NULL) {
+                x = g_value_get_int (data);
 
-                if ((data = (GValue *)g_hash_table_lookup(hints, "y")) != NULL)
-                {
-                        y = g_value_get_int(data);
+                if ((data = (GValue *) g_hash_table_lookup (hints, "y")) != NULL) {
+                        y = g_value_get_int (data);
                         use_pos_data = TRUE;
                 }
         }
 
         /* Deal with sound hints */
-        sound_enabled = gconf_client_get_bool(gconf_client,
-                                                                                  GCONF_KEY_SOUND_ENABLED, NULL);
-        data = (GValue *)g_hash_table_lookup(hints, "suppress-sound");
-
-        if (data != NULL)
-        {
-                if (G_VALUE_HOLDS_BOOLEAN(data))
-                        sound_enabled = !g_value_get_boolean(data);
-                else if (G_VALUE_HOLDS_INT(data))
-                        sound_enabled = (g_value_get_int(data) != 0);
-                else
-                {
-                        g_warning("suppress-sound is of type %s (expected bool or int)\n",
-                                  g_type_name(G_VALUE_TYPE(data)));
+        sound_enabled = gconf_client_get_bool (gconf_client,
+                                               GCONF_KEY_SOUND_ENABLED,
+                                               NULL);
+        data = (GValue *) g_hash_table_lookup (hints, "suppress-sound");
+
+        if (data != NULL) {
+                if (G_VALUE_HOLDS_BOOLEAN (data))
+                        sound_enabled = !g_value_get_boolean (data);
+                else if (G_VALUE_HOLDS_INT (data))
+                        sound_enabled = (g_value_get_int (data) != 0);
+                else {
+                        g_warning ("suppress-sound is of type %s (expected bool or int)\n",
+                                   g_type_name (G_VALUE_TYPE (data)));
                 }
         }
 
-        if (sound_enabled)
-        {
-                data = (GValue *)g_hash_table_lookup(hints, "sound-file");
+        if (sound_enabled) {
+                data = (GValue *) g_hash_table_lookup (hints, "sound-file");
 
-                if (data != NULL)
-                {
-                        sound_file = g_value_dup_string(data);
+                if (data != NULL) {
+                        sound_file = g_value_dup_string (data);
 
-                        if (*sound_file == '\0' ||
-                                !g_file_test(sound_file, G_FILE_TEST_EXISTS))
-                        {
-                                g_free(sound_file);
+                        if (*sound_file == '\0'
+                            || !g_file_test (sound_file, G_FILE_TEST_EXISTS)) {
+                                g_free (sound_file);
                                 sound_file = NULL;
                         }
                 }
         }
 
         /* set up action buttons */
-        for (i = 0; actions[i] != NULL; i += 2)
-        {
+        for (i = 0; actions[i] != NULL; i += 2) {
                 gchar *l = actions[i + 1];
 
-                if (l == NULL)
-                {
-                        g_warning("Label not found for action %s. "
-                                  "The protocol specifies that a label must "
-                                  "follow an action in the actions array", actions[i]);
+                if (l == NULL) {
+                        g_warning ("Label not found for action %s. "
+                                   "The protocol specifies that a label must "
+                                   "follow an action in the actions array",
+                                   actions[i]);
 
                         break;
                 }
 
-                if (strcasecmp(actions[i], "default"))
-                {
-                        theme_add_notification_action(nw, l, actions[i],
-                                                                                  G_CALLBACK(_action_invoked_cb));
+                if (strcasecmp (actions[i], "default")) {
+                        theme_add_notification_action (nw,
+                                                       l,
+                                                       actions[i],
+                                                       G_CALLBACK (_action_invoked_cb));
                 }
         }
 
         /* check for icon_data if icon == "" */
-        if (*icon == '\0')
-        {
-                data = (GValue *)g_hash_table_lookup(hints, "icon_data");
+        if (*icon == '\0') {
+                data = (GValue *) g_hash_table_lookup (hints, "icon_data");
 
                 if (data)
-                        _notify_daemon_process_icon_data(daemon, nw, data);
-        }
-        else
-        {
+                        _notify_daemon_process_icon_data (daemon, nw, data);
+        } else {
                 GdkPixbuf *pixbuf = NULL;
 
-                if (!strncmp(icon, "file://", 7) || *icon == '/')
-                {
-                        if (!strncmp(icon, "file://", 7))
+                if (!strncmp (icon, "file://", 7) || *icon == '/') {
+                        if (!strncmp (icon, "file://", 7))
                                 icon += 7;
 
                         /* Load file */
-                        pixbuf = gdk_pixbuf_new_from_file(icon, NULL);
-                }
-                else
-                {
+                        pixbuf = gdk_pixbuf_new_from_file (icon, NULL);
+                } else {
                         /* Load icon theme icon */
-                        GtkIconTheme *theme = gtk_icon_theme_get_default();
-                        GtkIconInfo *icon_info =
-                                gtk_icon_theme_lookup_icon(theme, icon, IMAGE_SIZE,
-                                                                                   GTK_ICON_LOOKUP_USE_BUILTIN);
+                        GtkIconTheme   *theme = gtk_icon_theme_get_default ();
+                        GtkIconInfo    *icon_info =
+                                gtk_icon_theme_lookup_icon (theme, icon,
+                                                            IMAGE_SIZE,
+                                                            GTK_ICON_LOOKUP_USE_BUILTIN);
 
-                        if (icon_info != NULL)
-                        {
-                                gint icon_size = MIN(IMAGE_SIZE,
-                                                     gtk_icon_info_get_base_size(icon_info));
+                        if (icon_info != NULL) {
+                                gint icon_size = MIN (IMAGE_SIZE,
+                                                      gtk_icon_info_get_base_size
+                                                      (icon_info));
 
                                 if (icon_size == 0)
                                         icon_size = IMAGE_SIZE;
 
-                                pixbuf = gtk_icon_theme_load_icon(theme, icon, icon_size,
-                                                                                                  GTK_ICON_LOOKUP_USE_BUILTIN,
-                                                                                                  NULL);
+                                pixbuf = gtk_icon_theme_load_icon (theme,
+                                                                   icon,
+                                                                   icon_size,
+                                                                   GTK_ICON_LOOKUP_USE_BUILTIN,
+                                                                   NULL);
 
-                                gtk_icon_info_free(icon_info);
+                                gtk_icon_info_free (icon_info);
                         }
 
-                        if (pixbuf == NULL)
-                        {
+                        if (pixbuf == NULL) {
                                 /* Well... maybe this is a file afterall. */
-                                pixbuf = gdk_pixbuf_new_from_file(icon, NULL);
+                                pixbuf = gdk_pixbuf_new_from_file (icon,
+                                                                   NULL);
                         }
                 }
 
-                if (pixbuf != NULL)
-                {
-                        theme_set_notification_icon(nw, pixbuf);
-                        g_object_unref(G_OBJECT(pixbuf));
+                if (pixbuf != NULL) {
+                        theme_set_notification_icon (nw, pixbuf);
+                        g_object_unref (G_OBJECT (pixbuf));
                 }
         }
 
 
-        if (window_xid != None && !theme_get_always_stack(nw))
-        {
+        if (window_xid != None && !theme_get_always_stack (nw)) {
                 /*
                  * Do nothing here if we were passed an XID; we'll call
                  * sync_notification_position later.
                  */
-        }
-        else if (use_pos_data && !theme_get_always_stack(nw))
-        {
+        } else if (use_pos_data && !theme_get_always_stack (nw)) {
                 /*
                  * Typically, the theme engine will set its own position based on
                  * the arrow X, Y hints. However, in case, move the notification to
                  * that position.
                  */
-                theme_set_notification_arrow(nw, TRUE, x, y);
-                theme_move_notification(nw, x, y);
-        }
-        else
-        {
-                gint monitor;
-                GdkScreen *screen;
-                gint x, y;
-
-                theme_set_notification_arrow(nw, FALSE, 0, 0);
-
-                gdk_display_get_pointer(gdk_display_get_default(),
-                                                                &screen, &x, &y, NULL);
-                monitor = gdk_screen_get_monitor_at_point(screen, x, y);
+                theme_set_notification_arrow (nw, TRUE, x, y);
+                theme_move_notification (nw, x, y);
+        } else {
+                gint            monitor;
+                GdkScreen      *screen;
+                gint            x, y;
+
+                theme_set_notification_arrow (nw, FALSE, 0, 0);
+
+                gdk_display_get_pointer (gdk_display_get_default (),
+                                         &screen,
+                                         &x,
+                                         &y,
+                                         NULL);
+                monitor = gdk_screen_get_monitor_at_point (screen, x, y);
                 if (monitor >= priv->stacks_size) {
                         reallocate_stacks (daemon);
                 }
 
-                notify_stack_add_window(priv->stacks[monitor], nw, new_notification);
+                notify_stack_add_window (priv->stacks[monitor],
+                                         nw,
+                                         new_notification);
         }
 
-        if (id == 0)
-        {
-                nt = _store_notification(daemon, nw, timeout);
+        if (id == 0) {
+                nt = _store_notification (daemon, nw, timeout);
                 return_id = nt->id;
-        }
-        else
+        } else
                 return_id = id;
 
         /*
@@ -1368,159 +1373,167 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
          * for changes, and reposition the window based on the source
          * window.  We need to do this after return_id is calculated.
          */
-        if (window_xid != None && !theme_get_always_stack(nw))
-        {
-                monitor_notification_source_windows(daemon, nt, window_xid);
-                sync_notification_position(daemon, nw, window_xid);
+        if (window_xid != None && !theme_get_always_stack (nw)) {
+                monitor_notification_source_windows (daemon, nt, window_xid);
+                sync_notification_position (daemon, nw, window_xid);
         }
 
-        if (!screensaver_active(GTK_WIDGET(nw)) &&
-                !fullscreen_window_exists(GTK_WIDGET(nw)))
-        {
-                theme_show_notification(nw);
+        if (!screensaver_active (GTK_WIDGET (nw))
+            && !fullscreen_window_exists (GTK_WIDGET (nw))) {
+                theme_show_notification (nw);
                 if (sound_file != NULL)
-                        sound_play_file(GTK_WIDGET(nw), sound_file);
+                        sound_play_file (GTK_WIDGET (nw), sound_file);
         }
 
-        g_free(sound_file);
+        g_free (sound_file);
 
 #if CHECK_DBUS_VERSION(0, 60)
-        sender = dbus_g_method_get_sender(context);
+        sender = dbus_g_method_get_sender (context);
 #else
-        sender = g_strdup(dbus_message_get_sender(
-                dbus_g_message_get_message(context->message)));
+        sender = g_strdup (dbus_message_get_sender (dbus_g_message_get_message (context->message)));
 #endif
 
-        g_object_set_data(G_OBJECT(nw), "_notify_id",
-                          GUINT_TO_POINTER(return_id));
-        g_object_set_data_full(G_OBJECT(nw), "_notify_sender", sender,
-                               (GDestroyNotify)g_free);
+        g_object_set_data (G_OBJECT (nw),
+                           "_notify_id",
+                           GUINT_TO_POINTER (return_id));
+        g_object_set_data_full (G_OBJECT (nw),
+                                "_notify_sender",
+                                sender,
+                                (GDestroyNotify) g_free);
 
         if (nt)
-                _calculate_timeout(daemon, nt, timeout);
+                _calculate_timeout (daemon, nt, timeout);
 
-        dbus_g_method_return(context, return_id);
+        dbus_g_method_return (context, return_id);
 
         return TRUE;
 }
 
 gboolean
-notify_daemon_close_notification_handler(NotifyDaemon *daemon,
-                                                                                 guint id, GError **error)
+notify_daemon_close_notification_handler (NotifyDaemon *daemon,
+                                          guint         id,
+                                          GError      **error)
 {
-        if (id == 0)
-        {
-                g_set_error(error, notify_daemon_error_quark(), 100,
-                            _("%u is not a valid notification ID"), id);
+        if (id == 0) {
+                g_set_error (error, notify_daemon_error_quark (), 100,
+                             _("%u is not a valid notification ID"), id);
                 return FALSE;
         } else {
-                _close_notification(daemon, id, TRUE, NOTIFYD_CLOSED_API);
+                _close_notification (daemon, id, TRUE, NOTIFYD_CLOSED_API);
                 return TRUE;
         }
 }
 
 gboolean
-notify_daemon_get_capabilities(NotifyDaemon *daemon, char ***caps)
+notify_daemon_get_capabilities (NotifyDaemon * daemon, char ***caps)
 {
-        *caps = g_new0(char *, 6);
+        *caps = g_new0 (char *, 6);
 
-        (*caps)[0] = g_strdup("actions");
-        (*caps)[1] = g_strdup("body");
-        (*caps)[2] = g_strdup("body-hyperlinks");
-        (*caps)[3] = g_strdup("body-markup");
-        (*caps)[4] = g_strdup("icon-static");
+        (*caps)[0] = g_strdup ("actions");
+        (*caps)[1] = g_strdup ("body");
+        (*caps)[2] = g_strdup ("body-hyperlinks");
+        (*caps)[3] = g_strdup ("body-markup");
+        (*caps)[4] = g_strdup ("icon-static");
         (*caps)[5] = NULL;
 
         return TRUE;
 }
 
 gboolean
-notify_daemon_get_server_information(NotifyDaemon *daemon,
-                                                                         char **out_name,
-                                                                         char **out_vendor,
-                                                                         char **out_version,
-                                                                         char **out_spec_ver)
+notify_daemon_get_server_information (NotifyDaemon *daemon,
+                                      char        **out_name,
+                                      char        **out_vendor,
+                                      char        **out_version,
+                                      char        **out_spec_ver)
 {
-        *out_name     = g_strdup("Notification Daemon");
-        *out_vendor   = g_strdup("Galago Project");
-        *out_version  = g_strdup(VERSION);
-        *out_spec_ver = g_strdup("1.0");
+        *out_name = g_strdup ("Notification Daemon");
+        *out_vendor = g_strdup ("Galago Project");
+        *out_version = g_strdup (VERSION);
+        *out_spec_ver = g_strdup ("1.0");
 
         return TRUE;
 }
 
-GConfClient *
-get_gconf_client(void)
+GConfClient    *
+get_gconf_client (void)
 {
         return gconf_client;
 }
 
 int
-main(int argc, char **argv)
+main (int argc, char **argv)
 {
-        NotifyDaemon *daemon;
+        NotifyDaemon   *daemon;
         DBusGConnection *connection;
-        DBusGProxy *bus_proxy;
-        GError *error;
-        guint request_name_result;
+        DBusGProxy     *bus_proxy;
+        GError         *error;
+        guint           request_name_result;
 
-        g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
+        g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
 
-        gtk_init(&argc, &argv);
-        gconf_init(argc, argv, NULL);
+        gtk_init (&argc, &argv);
+        gconf_init (argc, argv, NULL);
 
-        gconf_client = gconf_client_get_default();
-        gconf_client_add_dir(gconf_client, GCONF_KEY_DAEMON,
-                             GCONF_CLIENT_PRELOAD_NONE, NULL);
+        gconf_client = gconf_client_get_default ();
+        gconf_client_add_dir (gconf_client,
+                              GCONF_KEY_DAEMON,
+                              GCONF_CLIENT_PRELOAD_NONE,
+                              NULL);
 
         error = NULL;
 
-        connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+        connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
 
-        if (connection == NULL)
-        {
-                g_printerr("Failed to open connection to bus: %s\n",
-                                   error->message);
-                g_error_free(error);
-                exit(1);
+        if (connection == NULL) {
+                g_printerr ("Failed to open connection to bus: %s\n",
+                            error->message);
+                g_error_free (error);
+                exit (1);
         }
 
-        dbus_conn = dbus_g_connection_get_connection(connection);
-
-        dbus_g_object_type_install_info(NOTIFY_TYPE_DAEMON,
-                                                                        &dbus_glib_notification_daemon_object_info);
-
-        bus_proxy = dbus_g_proxy_new_for_name(connection,
-                                                                                  "org.freedesktop.DBus",
-                                                                                  "/org/freedesktop/DBus",
-                                                                                  "org.freedesktop.DBus");
-
-        if (!dbus_g_proxy_call(bus_proxy, "RequestName", &error,
-                               G_TYPE_STRING, "org.freedesktop.Notifications",
-                               G_TYPE_UINT, 0,
-                               G_TYPE_INVALID,
-                               G_TYPE_UINT, &request_name_result,
-                               G_TYPE_INVALID))
-        {
-                g_error("Could not aquire name: %s", error->message);
+        dbus_conn = dbus_g_connection_get_connection (connection);
+
+        dbus_g_object_type_install_info (NOTIFY_TYPE_DAEMON,
+                                         &dbus_glib_notification_daemon_object_info);
+
+        bus_proxy = dbus_g_proxy_new_for_name (connection,
+                                               "org.freedesktop.DBus",
+                                               "/org/freedesktop/DBus",
+                                               "org.freedesktop.DBus");
+
+        if (!dbus_g_proxy_call (bus_proxy,
+                                "RequestName",
+                                &error,
+                                G_TYPE_STRING,
+                                "org.freedesktop.Notifications",
+                                G_TYPE_UINT,
+                                0,
+                                G_TYPE_INVALID,
+                                G_TYPE_UINT,
+                                &request_name_result,
+                                G_TYPE_INVALID)) {
+                g_error ("Could not aquire name: %s", error->message);
         }
 
-        daemon = g_object_new(NOTIFY_TYPE_DAEMON, NULL);
+        daemon = g_object_new (NOTIFY_TYPE_DAEMON, NULL);
 
-        gconf_client_notify_add(gconf_client, GCONF_KEY_POPUP_LOCATION,
-                                                        popup_location_changed_cb, daemon,
-                                                        NULL, NULL);
+        gconf_client_notify_add (gconf_client,
+                                 GCONF_KEY_POPUP_LOCATION,
+                                 popup_location_changed_cb,
+                                 daemon,
+                                 NULL,
+                                 NULL);
 
         /* Emit signal to verify/set current key */
-        gconf_client_notify(gconf_client, GCONF_KEY_POPUP_LOCATION);
+        gconf_client_notify (gconf_client, GCONF_KEY_POPUP_LOCATION);
 
-        dbus_g_connection_register_g_object(connection,
-                                                                                "/org/freedesktop/Notifications",
-                                                                                G_OBJECT(daemon));
+        dbus_g_connection_register_g_object (connection,
+                                             "/org/freedesktop/Notifications",
+                                             G_OBJECT (daemon));
 
-        gtk_main();
+        gtk_main ();
 
-        g_object_unref(G_OBJECT(gconf_client));
+        g_object_unref (G_OBJECT (gconf_client));
 
         return 0;
 }
diff --git a/src/daemon/daemon.h b/src/daemon/daemon.h
index 43378eb..0ebfd96 100644
--- a/src/daemon/daemon.h
+++ b/src/daemon/daemon.h
@@ -63,16 +63,15 @@ typedef enum
         NOTIFYD_CLOSED_USER = 2,
         NOTIFYD_CLOSED_API = 3,
         NOTIFYD_CLOSED_RESERVED = 4
-
 } NotifydClosedReason;
 
-typedef struct _NotifyDaemon        NotifyDaemon;
-typedef struct _NotifyDaemonClass   NotifyDaemonClass;
+typedef struct _NotifyDaemon NotifyDaemon;
+typedef struct _NotifyDaemonClass NotifyDaemonClass;
 typedef struct _NotifyDaemonPrivate NotifyDaemonPrivate;
 
 struct _NotifyDaemon
 {
-        GObject parent;
+        GObject         parent;
 
         /*< private > */
         NotifyDaemonPrivate *priv;
@@ -80,41 +79,38 @@ struct _NotifyDaemon
 
 struct _NotifyDaemonClass
 {
-        GObjectClass parent_class;
+        GObjectClass    parent_class;
 };
 
-G_BEGIN_DECLS
-
-GType notify_daemon_get_type(void);
+G_BEGIN_DECLS GType notify_daemon_get_type (void);
 
-GQuark notify_daemon_error_quark(void);
+GQuark          notify_daemon_error_quark (void);
 
-gboolean notify_daemon_notify_handler(NotifyDaemon *daemon,
-                                      const gchar *app_name,
-                                      guint id,
-                                      const gchar *icon,
-                                      const gchar *summary,
-                                      const gchar *body,
-                                      gchar **actions,
-                                      GHashTable *hints,
-                                      int timeout,
-                                      DBusGMethodInvocation *context);
+gboolean        notify_daemon_notify_handler             (NotifyDaemon *daemon,
+                                                          const gchar  *app_name,
+                                                          guint         id,
+                                                          const gchar  *icon,
+                                                          const gchar  *summary,
+                                                          const gchar  *body,
+                                                          gchar       **actions,
+                                                          GHashTable   *hints,
+                                                          int           timeout,
+                                                          DBusGMethodInvocation *context);
 
-gboolean notify_daemon_close_notification_handler(NotifyDaemon *daemon,
-                                                  guint id,
-                                                  GError **error);
+gboolean        notify_daemon_close_notification_handler (NotifyDaemon *daemon,
+                                                          guint         id,
+                                                          GError      **error);
 
-gboolean notify_daemon_get_capabilities(NotifyDaemon *daemon,
-                                        char ***out_caps);
+gboolean        notify_daemon_get_capabilities           (NotifyDaemon *daemon,
+                                                          char       ***out_caps);
 
-gboolean notify_daemon_get_server_information(NotifyDaemon *daemon,
-                                              char **out_name,
-                                              char **out_vendor,
-                                              char **out_version,
-                                              char **out_spec_ver);
+gboolean        notify_daemon_get_server_information     (NotifyDaemon *daemon,
+                                                          char        **out_name,
+                                                          char        **out_vendor,
+                                                          char        **out_version,
+                                                          char        **out_spec_ver);
 
-GConfClient *get_gconf_client(void);
+GConfClient    *get_gconf_client (void);
 
 G_END_DECLS
-
 #endif /* NOTIFY_DAEMON_H */
diff --git a/src/daemon/engines.c b/src/daemon/engines.c
index 7fbc7be..cbd0a3f 100644
--- a/src/daemon/engines.c
+++ b/src/daemon/engines.c
@@ -8,55 +8,66 @@
 
 typedef struct
 {
-        GModule *module;
-        guint ref_count;
-
-        gboolean (*theme_check_init)(unsigned int major_ver,
-                                     unsigned int minor_ver,
-                                     unsigned int micro_ver);
-        void (*get_theme_info)(char **theme_name,
-                               char **theme_ver,
-                               char **author,
-                               char **homepage);
-        GtkWindow *(*create_notification)(UrlClickedCb url_clicked_cb);
-        void (*destroy_notification)(GtkWindow *nw);
-        void (*show_notification)(GtkWindow *nw);
-        void (*hide_notification)(GtkWindow *nw);
-        void (*set_notification_hints)(GtkWindow *nw, GHashTable *hints);
-        void (*set_notification_text)(GtkWindow *nw, const char *summary,
-                                      const char *body);
-        void (*set_notification_icon)(GtkWindow *nw, GdkPixbuf *pixbuf);
-        void (*set_notification_arrow)(GtkWindow *nw, gboolean visible,
-                                       int x, int y);
-        void (*add_notification_action)(GtkWindow *nw, const char *label,
-                                        const char *key, GCallback cb);
-        void (*clear_notification_actions)(GtkWindow *nw);
-        void (*move_notification)(GtkWindow *nw, int x, int y);
-        void (*set_notification_timeout)(GtkWindow *nw, glong timeout);
-        void (*notification_tick)(GtkWindow *nw, glong timeout);
-        gboolean (*get_always_stack)(GtkWindow *nw);
+        GModule        *module;
+        guint           ref_count;
+
+        gboolean        (*theme_check_init)           (unsigned int major_ver,
+                                                       unsigned int minor_ver,
+                                                       unsigned int micro_ver);
+        void            (*get_theme_info)             (char       **theme_name,
+                                                       char       **theme_ver,
+                                                       char       **author,
+                                                       char       **homepage);
+        GtkWindow      *(*create_notification)        (UrlClickedCb url_clicked_cb);
+        void            (*destroy_notification)       (GtkWindow   *nw);
+        void            (*show_notification)          (GtkWindow   *nw);
+        void            (*hide_notification)          (GtkWindow   *nw);
+        void            (*set_notification_hints)     (GtkWindow   *nw,
+                                                       GHashTable  *hints);
+        void            (*set_notification_text)      (GtkWindow   *nw,
+                                                       const char  *summary,
+                                                       const char  *body);
+        void            (*set_notification_icon)      (GtkWindow   *nw,
+                                                       GdkPixbuf   *pixbuf);
+        void            (*set_notification_arrow)     (GtkWindow   *nw,
+                                                       gboolean     visible,
+                                                       int          x,
+                                                       int          y);
+        void            (*add_notification_action)    (GtkWindow   *nw,
+                                                       const char  *label,
+                                                       const char  *key,
+                                                       GCallback    cb);
+        void            (*clear_notification_actions) (GtkWindow   *nw);
+        void            (*move_notification)          (GtkWindow   *nw,
+                                                       int          x,
+                                                       int          y);
+        void            (*set_notification_timeout)   (GtkWindow   *nw,
+                                                       glong        timeout);
+        void            (*notification_tick)          (GtkWindow   *nw,
+                                                       glong        timeout);
+        gboolean        (*get_always_stack)           (GtkWindow   *nw);
 
 } ThemeEngine;
 
-static guint theme_prop_notify_id = 0;
+static guint        theme_prop_notify_id = 0;
 static ThemeEngine *active_engine = NULL;
 
 static ThemeEngine *
-load_theme_engine(const char *name)
+load_theme_engine (const char *name)
 {
-        ThemeEngine *engine;
-        char *filename;
-        char *path;
+        ThemeEngine    *engine;
+        char           *filename;
+        char           *path;
 
-        filename = g_strdup_printf("lib%s.so", name);
-        path = g_build_filename(ENGINES_DIR, filename, NULL);
-        g_free(filename);
+        filename = g_strdup_printf ("lib%s.so", name);
+        path = g_build_filename (ENGINES_DIR, filename, NULL);
+        g_free (filename);
 
-        engine = g_new0(ThemeEngine, 1);
+        engine = g_new0 (ThemeEngine, 1);
         engine->ref_count = 1;
-        engine->module = g_module_open(path, G_MODULE_BIND_LAZY);
+        engine->module = g_module_open (path, G_MODULE_BIND_LAZY);
 
-        g_free(path);
+        g_free (path);
 
         if (engine->module == NULL)
                 goto error;
@@ -72,67 +83,66 @@ load_theme_engine(const char *name)
 #define BIND_OPTIONAL_FUNC(name) \
         g_module_symbol(engine->module, #name, (gpointer *)&engine->name);
 
-        BIND_REQUIRED_FUNC(theme_check_init);
-        BIND_REQUIRED_FUNC(get_theme_info);
-        BIND_REQUIRED_FUNC(create_notification);
-        BIND_REQUIRED_FUNC(set_notification_text);
-        BIND_REQUIRED_FUNC(set_notification_icon);
-        BIND_REQUIRED_FUNC(set_notification_arrow);
-        BIND_REQUIRED_FUNC(add_notification_action);
-        BIND_REQUIRED_FUNC(clear_notification_actions);
-        BIND_REQUIRED_FUNC(move_notification);
-
-        BIND_OPTIONAL_FUNC(destroy_notification);
-        BIND_OPTIONAL_FUNC(show_notification);
-        BIND_OPTIONAL_FUNC(hide_notification);
-        BIND_OPTIONAL_FUNC(set_notification_timeout);
-        BIND_OPTIONAL_FUNC(set_notification_hints);
-        BIND_OPTIONAL_FUNC(notification_tick);
-        BIND_OPTIONAL_FUNC(get_always_stack);
-
-        if (!engine->theme_check_init(NOTIFICATION_DAEMON_MAJOR_VERSION,
-                                      NOTIFICATION_DAEMON_MINOR_VERSION,
-                                      NOTIFICATION_DAEMON_MICRO_VERSION))
-        {
-                g_warning("Theme doesn't work with this version of notification-daemon");
+        BIND_REQUIRED_FUNC (theme_check_init);
+        BIND_REQUIRED_FUNC (get_theme_info);
+        BIND_REQUIRED_FUNC (create_notification);
+        BIND_REQUIRED_FUNC (set_notification_text);
+        BIND_REQUIRED_FUNC (set_notification_icon);
+        BIND_REQUIRED_FUNC (set_notification_arrow);
+        BIND_REQUIRED_FUNC (add_notification_action);
+        BIND_REQUIRED_FUNC (clear_notification_actions);
+        BIND_REQUIRED_FUNC (move_notification);
+
+        BIND_OPTIONAL_FUNC (destroy_notification);
+        BIND_OPTIONAL_FUNC (show_notification);
+        BIND_OPTIONAL_FUNC (hide_notification);
+        BIND_OPTIONAL_FUNC (set_notification_timeout);
+        BIND_OPTIONAL_FUNC (set_notification_hints);
+        BIND_OPTIONAL_FUNC (notification_tick);
+        BIND_OPTIONAL_FUNC (get_always_stack);
+
+        if (!engine->theme_check_init (NOTIFICATION_DAEMON_MAJOR_VERSION,
+                                       NOTIFICATION_DAEMON_MINOR_VERSION,
+                                       NOTIFICATION_DAEMON_MICRO_VERSION)) {
+                g_warning ("Theme doesn't work with this version of notification-daemon");
                 goto error;
         }
 
         return engine;
 
-error:
-        if (engine->module != NULL && !g_module_close(engine->module))
-                g_warning("%s: %s", filename, g_module_error());
+      error:
+        if (engine->module != NULL && !g_module_close (engine->module))
+                g_warning ("%s: %s", filename, g_module_error ());
 
-        g_free(engine);
+        g_free (engine);
         return NULL;
 }
 
 static void
-destroy_engine(ThemeEngine *engine)
+destroy_engine (ThemeEngine * engine)
 {
-        g_assert(engine->ref_count == 0);
+        g_assert (engine->ref_count == 0);
 
         if (active_engine == engine)
                 active_engine = NULL;
 
-        g_module_close(engine->module);
-        g_free(engine);
+        g_module_close (engine->module);
+        g_free (engine);
 }
 
 static gboolean
-theme_engine_destroy(ThemeEngine *engine)
+theme_engine_destroy (ThemeEngine * engine)
 {
-        destroy_engine(engine);
+        destroy_engine (engine);
         return FALSE;
 }
 
 static void
-theme_engine_unref(ThemeEngine *engine)
+theme_engine_unref (ThemeEngine * engine)
 {
         engine->ref_count--;
 
-        if (engine->ref_count == 0)
+        if (engine->ref_count == 0) {
                 /*
                  * Destroy the engine in an idle loop since the last reference
                  * might have been the one of a notification which is being
@@ -140,189 +150,217 @@ theme_engine_unref(ThemeEngine *engine)
                  * module. This way, we're sure the notification is completely
                  * destroyed before the engine is.
                  */
-                g_idle_add((GSourceFunc) theme_engine_destroy, engine);
+                g_idle_add ((GSourceFunc) theme_engine_destroy, engine);
+        }
 }
 
 static void
-theme_changed_cb(GConfClient *client,
-                 guint cnxn_id,
-                 GConfEntry *entry,
-                 gpointer user_data)
+theme_changed_cb (GConfClient *client,
+                  guint        cnxn_id,
+                  GConfEntry  *entry,
+                  gpointer     user_data)
 {
         if (active_engine == NULL)
                 return;
 
-        theme_engine_unref(active_engine);
+        theme_engine_unref (active_engine);
 
         /* This is no longer the true active engine, so reset this. */
         active_engine = NULL;
 }
 
 static ThemeEngine *
-get_theme_engine(void)
+get_theme_engine (void)
 {
-        if (active_engine == NULL)
-        {
-                GConfClient *client = get_gconf_client();
-                char *enginename = gconf_client_get_string(client, GCONF_KEY_THEME,
-                                                                                                   NULL);
-
-                if (theme_prop_notify_id == 0)
-                {
-                        theme_prop_notify_id = gconf_client_notify_add(client,
-                                                                       "/apps/notification-daemon/theme", theme_changed_cb, NULL,
-                                                                       NULL, NULL);
+        if (active_engine == NULL) {
+                GConfClient    *client;
+                char           *enginename;
+
+                client = get_gconf_client;
+                enginename = gconf_client_get_string (client,
+                                                      GCONF_KEY_THEME,
+                                                      NULL);
+
+                if (theme_prop_notify_id == 0) {
+                        theme_prop_notify_id =
+                                gconf_client_notify_add (client,
+                                                         "/apps/notification-daemon/theme",
+                                                         theme_changed_cb,
+                                                         NULL,
+                                                         NULL,
+                                                         NULL);
                 }
 
-                if (enginename == NULL)
-                {
-                        active_engine = load_theme_engine("standard");
-                        g_assert(active_engine != NULL);
-                }
-                else
-                {
-                        active_engine = load_theme_engine(enginename);
-
-                        if (active_engine == NULL)
-                        {
-                                g_warning("Unable to load theme engine '%s'", enginename);
-                                active_engine = load_theme_engine("standard");
+                if (enginename == NULL) {
+                        active_engine = load_theme_engine ("standard");
+                        g_assert (active_engine != NULL);
+                } else {
+                        active_engine = load_theme_engine (enginename);
+
+                        if (active_engine == NULL) {
+                                g_warning ("Unable to load theme engine '%s'",
+                                           enginename);
+                                active_engine = load_theme_engine ("standard");
                         }
 
-                        g_free(enginename);
+                        g_free (enginename);
 
-                        g_assert(active_engine != NULL);
+                        g_assert (active_engine != NULL);
                 }
         }
 
         return active_engine;
 }
 
-GtkWindow *
-theme_create_notification(UrlClickedCb url_clicked_cb)
+GtkWindow      *
+theme_create_notification (UrlClickedCb url_clicked_cb)
 {
-        ThemeEngine *engine = get_theme_engine();
-        GtkWindow *nw = engine->create_notification(url_clicked_cb);
-        g_object_set_data_full(G_OBJECT(nw), "_theme_engine", engine,
-                               (GDestroyNotify)theme_engine_unref);
+        ThemeEngine *engine;
+        GtkWindow   *nw
+
+        engine = get_theme_engine ();
+        nw = engine->create_notification (url_clicked_cb);
+        g_object_set_data_full (G_OBJECT (nw),
+                                "_theme_engine",
+                                engine,
+                                (GDestroyNotify) theme_engine_unref);
         engine->ref_count++;
         return nw;
 }
 
 void
-theme_destroy_notification(GtkWindow *nw)
+theme_destroy_notification (GtkWindow * nw)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->destroy_notification != NULL)
-                engine->destroy_notification(nw);
+                engine->destroy_notification (nw);
         else
-                gtk_widget_destroy(GTK_WIDGET(nw));
+                gtk_widget_destroy (GTK_WIDGET (nw));
 }
 
 void
-theme_show_notification(GtkWindow *nw)
+theme_show_notification (GtkWindow * nw)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->show_notification != NULL)
-                engine->show_notification(nw);
+                engine->show_notification (nw);
         else
-                gtk_widget_show(GTK_WIDGET(nw));
+                gtk_widget_show (GTK_WIDGET (nw));
 }
 
 void
-theme_hide_notification(GtkWindow *nw)
+theme_hide_notification (GtkWindow * nw)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->hide_notification != NULL)
-                engine->hide_notification(nw);
+                engine->hide_notification (nw);
         else
-                gtk_widget_hide(GTK_WIDGET(nw));
+                gtk_widget_hide (GTK_WIDGET (nw));
 }
 
 void
-theme_set_notification_hints(GtkWindow *nw, GHashTable *hints)
+theme_set_notification_hints (GtkWindow * nw, GHashTable * hints)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->set_notification_hints != NULL)
-                engine->set_notification_hints(nw, hints);
+                engine->set_notification_hints (nw, hints);
 }
 
 void
-theme_set_notification_timeout(GtkWindow *nw, glong timeout)
+theme_set_notification_timeout (GtkWindow * nw, glong timeout)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->set_notification_timeout != NULL)
-                engine->set_notification_timeout(nw, timeout);
+                engine->set_notification_timeout (nw, timeout);
 }
 
 void
-theme_notification_tick(GtkWindow *nw, glong remaining)
+theme_notification_tick (GtkWindow * nw, glong remaining)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->notification_tick != NULL)
-                engine->notification_tick(nw, remaining);
+                engine->notification_tick (nw, remaining);
 }
 
 void
-theme_set_notification_text(GtkWindow *nw,
-                            const char *summary,
-                            const char *body)
+theme_set_notification_text (GtkWindow * nw,
+                             const char *summary, const char *body)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-        engine->set_notification_text(nw, summary, body);
+        ThemeEngine *engine;
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
+        engine->set_notification_text (nw, summary, body);
 }
 
 void
-theme_set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf)
+theme_set_notification_icon (GtkWindow * nw, GdkPixbuf * pixbuf)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-        engine->set_notification_icon(nw, pixbuf);
+        ThemeEngine *engine;
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
+        engine->set_notification_icon (nw, pixbuf);
 }
 
 void
-theme_set_notification_arrow(GtkWindow *nw, gboolean visible, int x, int y)
+theme_set_notification_arrow (GtkWindow * nw, gboolean visible, int x, int y)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-        engine->set_notification_arrow(nw, visible, x, y);
+        ThemeEngine *engine;
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
+        engine->set_notification_arrow (nw, visible, x, y);
 }
 
 void
-theme_add_notification_action(GtkWindow *nw,
-                              const char *label,
-                              const char *key,
-                              GCallback cb)
+theme_add_notification_action (GtkWindow * nw,
+                               const char *label,
+                               const char *key, GCallback cb)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-        engine->add_notification_action(nw, label, key, cb);
+        ThemeEngine *engine;
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
+        engine->add_notification_action (nw, label, key, cb);
 }
 
 void
-theme_clear_notification_actions(GtkWindow *nw)
+theme_clear_notification_actions (GtkWindow * nw)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-        engine->clear_notification_actions(nw);
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
+        engine->clear_notification_actions (nw);
 }
 
 void
-theme_move_notification(GtkWindow *nw, int x, int y)
+theme_move_notification (GtkWindow * nw, int x, int y)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-        engine->move_notification(nw, x, y);
+        ThemeEngine *engine;
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
+        engine->move_notification (nw, x, y);
 }
 
 gboolean
-theme_get_always_stack(GtkWindow *nw)
+theme_get_always_stack (GtkWindow * nw)
 {
-        ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
+        ThemeEngine *engine;
+
+        engine = g_object_get_data (G_OBJECT (nw), "_theme_engine");
 
         if (engine->get_always_stack != NULL)
-                return engine->get_always_stack(nw);
+                return engine->get_always_stack (nw);
         else
                 return FALSE;
 }
diff --git a/src/daemon/engines.h b/src/daemon/engines.h
index 8325338..6556e33 100644
--- a/src/daemon/engines.h
+++ b/src/daemon/engines.h
@@ -5,29 +5,35 @@
 
 #include <gtk/gtk.h>
 
-typedef void (*UrlClickedCb)(GtkWindow *nw, const char *url);
+typedef void    (*UrlClickedCb) (GtkWindow * nw, const char *url);
 
-GtkWindow *theme_create_notification(UrlClickedCb url_clicked_cb);
-void theme_destroy_notification(GtkWindow *nw);
-void theme_show_notification(GtkWindow *nw);
-void theme_hide_notification(GtkWindow *nw);
-void theme_set_notification_hints(GtkWindow *nw, GHashTable *hints);
-void theme_set_notification_timeout(GtkWindow *nw, glong timeout);
-void theme_notification_tick(GtkWindow *nw, glong remaining);
-void theme_set_notification_text(GtkWindow *nw,
-                                 const char *summary,
-                                 const char *body);
-void theme_set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf);
-void theme_set_notification_arrow(GtkWindow *nw,
-                                  gboolean visible,
-                                  int x,
-                                  int y);
-void theme_add_notification_action(GtkWindow *nw,
-                                   const char *label,
-                                   const char *key,
-                                   GCallback cb);
-void theme_clear_notification_actions(GtkWindow *nw);
-void theme_move_notification(GtkWindow *nw, int x, int y);
-gboolean theme_get_always_stack(GtkWindow *nw);
+GtkWindow      *theme_create_notification        (UrlClickedCb url_clicked_cb);
+void            theme_destroy_notification       (GtkWindow   *nw);
+void            theme_show_notification          (GtkWindow   *nw);
+void            theme_hide_notification          (GtkWindow   *nw);
+void            theme_set_notification_hints     (GtkWindow   *nw,
+                                                  GHashTable  *hints);
+void            theme_set_notification_timeout   (GtkWindow   *nw,
+                                                  glong        timeout);
+void            theme_notification_tick          (GtkWindow   *nw,
+                                                  glong        remaining);
+void            theme_set_notification_text      (GtkWindow   *nw,
+                                                  const char  *summary,
+                                                  const char  *body);
+void            theme_set_notification_icon      (GtkWindow   *nw,
+                                                  GdkPixbuf   *pixbuf);
+void            theme_set_notification_arrow     (GtkWindow   *nw,
+                                                  gboolean     visible,
+                                                  int          x,
+                                                  int          y);
+void            theme_add_notification_action    (GtkWindow   *nw,
+                                                  const char  *label,
+                                                  const char  *key,
+                                                  GCallback    cb);
+void            theme_clear_notification_actions (GtkWindow   *nw);
+void            theme_move_notification          (GtkWindow   *nw,
+                                                  int          x,
+                                                  int          y);
+gboolean        theme_get_always_stack           (GtkWindow   *nw);
 
 #endif /* _ENGINES_H_ */
diff --git a/src/daemon/stack.c b/src/daemon/stack.c
index ec3d377..f569f34 100644
--- a/src/daemon/stack.c
+++ b/src/daemon/stack.c
@@ -33,195 +33,214 @@
 
 struct _NotifyStack
 {
-        NotifyDaemon *daemon;
-        GdkScreen *screen;
-        guint monitor;
+        NotifyDaemon       *daemon;
+        GdkScreen          *screen;
+        guint               monitor;
         NotifyStackLocation location;
-        GSList *windows;
+        GSList             *windows;
 };
 
 static gboolean
-get_work_area(GtkWidget *nw, GdkRectangle *rect)
+get_work_area (GtkWidget * nw, GdkRectangle * rect)
 {
-        Atom workarea = XInternAtom(GDK_DISPLAY(), "_NET_WORKAREA", True);
-        Atom type;
-        Window win;
-        int format;
-        gulong num, leftovers;
-        gulong max_len = 4 * 32;
-        guchar *ret_workarea;
-        long *workareas;
-        int result;
-        GdkScreen *screen;
-        int disp_screen;
-
-        gtk_widget_realize(nw);
-        screen = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
-        disp_screen = GDK_SCREEN_XNUMBER(screen);
+        Atom            workarea;
+        Atom            type;
+        Window          win;
+        int             format;
+        gulong          num, leftovers;
+        gulong          max_len = 4 * 32;
+        guchar         *ret_workarea;
+        long           *workareas;
+        int             result;
+        GdkScreen      *screen;
+        int             disp_screen;
+
+        workarea = XInternAtom (GDK_DISPLAY (), "_NET_WORKAREA", True);
+        gtk_widget_realize (nw);
+        screen = gdk_drawable_get_screen (GDK_DRAWABLE (nw->window));
+        disp_screen = GDK_SCREEN_XNUMBER (screen);
 
         /* Defaults in case of error */
         rect->x = 0;
         rect->y = 0;
-        rect->width = gdk_screen_get_width(screen);
-        rect->height = gdk_screen_get_height(screen);
+        rect->width = gdk_screen_get_width (screen);
+        rect->height = gdk_screen_get_height (screen);
 
         if (workarea == None)
                 return FALSE;
 
-        win = XRootWindow(GDK_DISPLAY(), disp_screen);
-        result = XGetWindowProperty(GDK_DISPLAY(), win, workarea, 0,
-                                    max_len, False, AnyPropertyType,
-                                    &type, &format, &num, &leftovers,
-                                    &ret_workarea);
-
-        if (result != Success || type == None || format == 0 || leftovers ||
-                num % 4)
-        {
+        win = XRootWindow (GDK_DISPLAY (), disp_screen);
+        result = XGetWindowProperty (GDK_DISPLAY (),
+                                     win,
+                                     workarea,
+                                     0,
+                                     max_len,
+                                     False,
+                                     AnyPropertyType,
+                                     &type,
+                                     &format,
+                                     &num,
+                                     &leftovers,
+                                     &ret_workarea);
+
+        if (result != Success
+            || type == None
+            || format == 0
+            || leftovers
+            || num % 4) {
                 return FALSE;
         }
 
-        workareas = (long *)ret_workarea;
-        rect->x      = workareas[disp_screen * 4];
-        rect->y      = workareas[disp_screen * 4 + 1];
-        rect->width  = workareas[disp_screen * 4 + 2];
+        workareas = (long *) ret_workarea;
+        rect->x = workareas[disp_screen * 4];
+        rect->y = workareas[disp_screen * 4 + 1];
+        rect->width = workareas[disp_screen * 4 + 2];
         rect->height = workareas[disp_screen * 4 + 3];
 
-        XFree(ret_workarea);
+        XFree (ret_workarea);
 
         return TRUE;
 }
 
 static void
-get_origin_coordinates(NotifyStackLocation stack_location,
-                       GdkRectangle *workarea,
-                       gint *x, gint *y,
-                       gint *shiftx, gint *shifty,
-                       gint width, gint height)
+get_origin_coordinates (NotifyStackLocation stack_location,
+                        GdkRectangle       *workarea,
+                        gint               *x,
+                        gint               *y,
+                        gint               *shiftx,
+                        gint               *shifty,
+                        gint                width,
+                        gint                height)
 {
-        switch (stack_location)
-        {
-                case NOTIFY_STACK_LOCATION_TOP_LEFT:
-                        *x = workarea->x;
-                        *y = workarea->y;
-                        *shifty = height;
-                        break;
-
-                case NOTIFY_STACK_LOCATION_TOP_RIGHT:
-                        *x = workarea->x + workarea->width - width;
-                        *y = workarea->y;
-                        *shifty = height;
-                        break;
-
-                case NOTIFY_STACK_LOCATION_BOTTOM_LEFT:
-                        *x = workarea->x;
-                        *y = workarea->y + workarea->height - height;
-                        break;
-
-                case NOTIFY_STACK_LOCATION_BOTTOM_RIGHT:
-                        *x = workarea->x + workarea->width - width;
-                        *y = workarea->y + workarea->height - height;
-                        break;
-
-                default:
-                        g_assert_not_reached();
+        switch (stack_location) {
+        case NOTIFY_STACK_LOCATION_TOP_LEFT:
+                *x = workarea->x;
+                *y = workarea->y;
+                *shifty = height;
+                break;
+
+        case NOTIFY_STACK_LOCATION_TOP_RIGHT:
+                *x = workarea->x + workarea->width - width;
+                *y = workarea->y;
+                *shifty = height;
+                break;
+
+        case NOTIFY_STACK_LOCATION_BOTTOM_LEFT:
+                *x = workarea->x;
+                *y = workarea->y + workarea->height - height;
+                break;
+
+        case NOTIFY_STACK_LOCATION_BOTTOM_RIGHT:
+                *x = workarea->x + workarea->width - width;
+                *y = workarea->y + workarea->height - height;
+                break;
+
+        default:
+                g_assert_not_reached ();
         }
 }
 
 static void
-translate_coordinates(NotifyStackLocation stack_location,
-                      GdkRectangle *workarea,
-                      gint *x, gint *y,
-                      gint *shiftx, gint *shifty,
-                      gint width, gint height,
-                      gint index)
+translate_coordinates (NotifyStackLocation stack_location,
+                       GdkRectangle       *workarea,
+                       gint               *x,
+                       gint               *y,
+                       gint               *shiftx,
+                       gint               *shifty,
+                       gint                width,
+                       gint                height,
+                       gint                index)
 {
-        switch (stack_location)
-        {
-                case NOTIFY_STACK_LOCATION_TOP_LEFT:
-                        *x = workarea->x;
-                        *y += *shifty;
-                        *shifty = height;
-                        break;
-
-                case NOTIFY_STACK_LOCATION_TOP_RIGHT:
-                        *x = workarea->x + workarea->width - width;
-                        *y += *shifty;
-                        *shifty = height;
-                        break;
-
-                case NOTIFY_STACK_LOCATION_BOTTOM_LEFT:
-                        *x = workarea->x;
-                        *y -= height;
-                        break;
-
-                case NOTIFY_STACK_LOCATION_BOTTOM_RIGHT:
-                        *x = workarea->x + workarea->width - width;
-                        *y -= height;
-                        break;
-
-                default:
-                        g_assert_not_reached();
+        switch (stack_location) {
+        case NOTIFY_STACK_LOCATION_TOP_LEFT:
+                *x = workarea->x;
+                *y += *shifty;
+                *shifty = height;
+                break;
+
+        case NOTIFY_STACK_LOCATION_TOP_RIGHT:
+                *x = workarea->x + workarea->width - width;
+                *y += *shifty;
+                *shifty = height;
+                break;
+
+        case NOTIFY_STACK_LOCATION_BOTTOM_LEFT:
+                *x = workarea->x;
+                *y -= height;
+                break;
+
+        case NOTIFY_STACK_LOCATION_BOTTOM_RIGHT:
+                *x = workarea->x + workarea->width - width;
+                *y -= height;
+                break;
+
+        default:
+                g_assert_not_reached ();
         }
 }
 
-NotifyStack *
-notify_stack_new(NotifyDaemon *daemon,
-                 GdkScreen *screen,
-                 guint monitor,
-                 NotifyStackLocation location)
+NotifyStack    *
+notify_stack_new (NotifyDaemon       *daemon,
+                  GdkScreen          *screen,
+                  guint               monitor,
+                  NotifyStackLocation location)
 {
-        NotifyStack *stack;
+        NotifyStack    *stack;
 
-        g_assert(daemon != NULL);
-        g_assert(screen != NULL && GDK_IS_SCREEN(screen));
-        g_assert(monitor < gdk_screen_get_n_monitors(screen));
-        g_assert(location != NOTIFY_STACK_LOCATION_UNKNOWN);
+        g_assert (daemon != NULL);
+        g_assert (screen != NULL && GDK_IS_SCREEN (screen));
+        g_assert (monitor < gdk_screen_get_n_monitors (screen));
+        g_assert (location != NOTIFY_STACK_LOCATION_UNKNOWN);
 
-        stack = g_new0(NotifyStack, 1);
-        stack->daemon   = daemon;
-        stack->screen   = screen;
-        stack->monitor  = monitor;
+        stack = g_new0 (NotifyStack, 1);
+        stack->daemon = daemon;
+        stack->screen = screen;
+        stack->monitor = monitor;
         stack->location = location;
 
         return stack;
 }
 
 void
-notify_stack_destroy(NotifyStack *stack)
+notify_stack_destroy (NotifyStack *stack)
 {
-        g_assert(stack != NULL);
+        g_assert (stack != NULL);
 
-        g_slist_free(stack->windows);
-        g_free(stack);
+        g_slist_free (stack->windows);
+        g_free (stack);
 }
 
 void
-notify_stack_set_location(NotifyStack *stack,
-                          NotifyStackLocation location)
+notify_stack_set_location (NotifyStack        *stack,
+                           NotifyStackLocation location)
 {
         stack->location = location;
 }
 
 static void
-notify_stack_shift_notifications(NotifyStack *stack,
-                                 GtkWindow *nw,
-                                 GSList **nw_l,
-                                 gint init_width,
-                                 gint init_height,
-                                 gint *nw_x,
-                                 gint *nw_y)
+notify_stack_shift_notifications (NotifyStack *stack,
+                                  GtkWindow   *nw,
+                                  GSList     **nw_l,
+                                  gint         init_width,
+                                  gint         init_height,
+                                  gint        *nw_x,
+                                  gint        *nw_y)
 {
-        GdkRectangle workarea;
-        GdkRectangle monitor;
-        GSList *l;
-        gint x, y, shiftx = 0, shifty = 0, index = 1;
-
-        get_work_area(GTK_WIDGET(nw), &workarea);
-        gdk_screen_get_monitor_geometry (stack->screen, stack->monitor, &monitor);
+        GdkRectangle    workarea;
+        GdkRectangle    monitor;
+        GSList         *l;
+        gint            x, y;
+        gint            shiftx = 0;
+        gint            shifty = 0;
+        gint            index = 1;
+
+        get_work_area (GTK_WIDGET (nw), &workarea);
+        gdk_screen_get_monitor_geometry (stack->screen, stack->monitor,
+                                         &monitor);
         gdk_rectangle_intersect (&monitor, &workarea, &workarea);
 
-        get_origin_coordinates(stack->location, &workarea, &x, &y,
-                               &shiftx, &shifty, init_width, init_height);
+        get_origin_coordinates (stack->location, &workarea, &x, &y,
+                                &shiftx, &shifty, init_width, init_height);
 
         if (nw_x != NULL)
                 *nw_x = x;
@@ -229,60 +248,73 @@ notify_stack_shift_notifications(NotifyStack *stack,
         if (nw_y != NULL)
                 *nw_y = y;
 
-        for (l = stack->windows; l != NULL; l = l->next)
-        {
-                GtkWindow *nw2 = GTK_WINDOW(l->data);
-                GtkRequisition req;
-
-                if (nw2 != nw)
-                {
-                        gtk_widget_size_request(GTK_WIDGET(nw2), &req);
-
-                        translate_coordinates(stack->location, &workarea, &x, &y,
-                                              &shiftx, &shifty, req.width + NOTIFY_STACK_SPACING, req.height + NOTIFY_STACK_SPACING,
-                                              index++);
-                        theme_move_notification(nw2, x, y);
-                }
-                else if (nw_l != NULL)
-                {
+        for (l = stack->windows; l != NULL; l = l->next) {
+                GtkWindow      *nw2 = GTK_WINDOW (l->data);
+                GtkRequisition  req;
+
+                if (nw2 != nw) {
+                        gtk_widget_size_request (GTK_WIDGET (nw2), &req);
+
+                        translate_coordinates (stack->location,
+                                               &workarea,
+                                               &x,
+                                               &y,
+                                               &shiftx,
+                                               &shifty,
+                                               req.width + NOTIFY_STACK_SPACING,
+                                               req.height + NOTIFY_STACK_SPACING,
+                                               index++);
+                        theme_move_notification (nw2, x, y);
+                } else if (nw_l != NULL) {
                         *nw_l = l;
                 }
         }
 }
 
 void
-notify_stack_add_window(NotifyStack *stack,
-                        GtkWindow *nw,
-                        gboolean new_notification)
+notify_stack_add_window (NotifyStack *stack,
+                         GtkWindow   *nw,
+                         gboolean     new_notification)
 {
-        GtkRequisition req;
-        gint x, y;
-
-        gtk_widget_size_request(GTK_WIDGET(nw), &req);
-        notify_stack_shift_notifications(stack, nw, NULL,
-                                         req.width + NOTIFY_STACK_SPACING, req.height + NOTIFY_STACK_SPACING, &x, &y);
-        theme_move_notification(nw, x, y);
-
-        if (new_notification)
-        {
-                g_signal_connect_swapped(G_OBJECT(nw), "destroy",
-                                         G_CALLBACK(notify_stack_remove_window),
-                                         stack);
-                stack->windows = g_slist_prepend(stack->windows, nw);
+        GtkRequisition  req;
+        gint            x, y;
+
+        gtk_widget_size_request (GTK_WIDGET (nw), &req);
+        notify_stack_shift_notifications (stack,
+                                          nw,
+                                          NULL,
+                                          req.width + NOTIFY_STACK_SPACING,
+                                          req.height + NOTIFY_STACK_SPACING,
+                                          &x,
+                                          &y);
+        theme_move_notification (nw, x, y);
+
+        if (new_notification) {
+                g_signal_connect_swapped (G_OBJECT (nw),
+                                          "destroy",
+                                          G_CALLBACK (notify_stack_remove_window),
+                                          stack);
+                stack->windows = g_slist_prepend (stack->windows, nw);
         }
 }
 
 void
-notify_stack_remove_window(NotifyStack *stack,
-                           GtkWindow *nw)
+notify_stack_remove_window (NotifyStack *stack,
+                            GtkWindow   *nw)
 {
-        GSList *remove_l = NULL;
+        GSList         *remove_l = NULL;
 
-        notify_stack_shift_notifications(stack, nw, &remove_l, 0, 0, NULL, NULL);
+        notify_stack_shift_notifications (stack,
+                                          nw,
+                                          &remove_l,
+                                          0,
+                                          0,
+                                          NULL,
+                                          NULL);
 
         if (remove_l != NULL)
-                stack->windows = g_slist_delete_link(stack->windows, remove_l);
+                stack->windows = g_slist_delete_link (stack->windows, remove_l);
 
-        if (GTK_WIDGET_REALIZED(GTK_WIDGET(nw)))
-                gtk_widget_unrealize(GTK_WIDGET(nw));
+        if (GTK_WIDGET_REALIZED (GTK_WIDGET (nw)))
+                gtk_widget_unrealize (GTK_WIDGET (nw));
 }
diff --git a/src/daemon/stack.h b/src/daemon/stack.h
index d7c8429..0e14b38 100644
--- a/src/daemon/stack.h
+++ b/src/daemon/stack.h
@@ -33,23 +33,22 @@ typedef enum
         NOTIFY_STACK_LOCATION_BOTTOM_LEFT,
         NOTIFY_STACK_LOCATION_BOTTOM_RIGHT,
         NOTIFY_STACK_LOCATION_DEFAULT = NOTIFY_STACK_LOCATION_BOTTOM_RIGHT
-
 } NotifyStackLocation;
 
 typedef struct _NotifyStack NotifyStack;
 
-NotifyStack *notify_stack_new(NotifyDaemon *daemon,
-                              GdkScreen *screen,
-                              guint monitor,
-                              NotifyStackLocation stack_location);
-void notify_stack_destroy(NotifyStack *stack);
+NotifyStack    *notify_stack_new           (NotifyDaemon       *daemon,
+                                            GdkScreen          *screen,
+                                            guint               monitor,
+                                            NotifyStackLocation stack_location);
+void            notify_stack_destroy       (NotifyStack        *stack);
 
-void notify_stack_set_location(NotifyStack *stack,
-                               NotifyStackLocation location);
-void notify_stack_add_window(NotifyStack *stack,
-                             GtkWindow *nw,
-                             gboolean new_notification);
-void notify_stack_remove_window(NotifyStack *stack,
-                                GtkWindow *nw);
+void            notify_stack_set_location  (NotifyStack        *stack,
+                                            NotifyStackLocation location);
+void            notify_stack_add_window    (NotifyStack        *stack,
+                                            GtkWindow          *nw,
+                                            gboolean            new_notification);
+void            notify_stack_remove_window (NotifyStack        *stack,
+                                            GtkWindow          *nw);
 
 #endif /* _NOTIFY_STACK_H_ */
diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c
index 78dfccc..221bce3 100644
--- a/src/themes/standard/theme.c
+++ b/src/themes/standard/theme.c
@@ -4,52 +4,52 @@
 
 #include <gtk/gtk.h>
 
-typedef void (*ActionInvokedCb)(GtkWindow *nw, const char *key);
-typedef void (*UrlClickedCb)(GtkWindow *nw, const char *url);
+typedef void    (*ActionInvokedCb) (GtkWindow * nw, const char *key);
+typedef void    (*UrlClickedCb)    (GtkWindow * nw, const char *url);
 
 typedef struct
 {
-        GtkWidget *win;
-        GtkWidget *top_spacer;
-        GtkWidget *bottom_spacer;
-        GtkWidget *main_hbox;
-        GtkWidget *iconbox;
-        GtkWidget *icon;
-        GtkWidget *content_hbox;
-        GtkWidget *summary_label;
-        GtkWidget *close_button;
-        GtkWidget *body_label;
-        GtkWidget *actions_box;
-        GtkWidget *last_sep;
-        GtkWidget *stripe_spacer;
-        GtkWidget *pie_countdown;
-
-        gboolean has_arrow;
-        gboolean enable_transparency;
-
-        int point_x;
-        int point_y;
-
-        int drawn_arrow_begin_x;
-        int drawn_arrow_begin_y;
-        int drawn_arrow_middle_x;
-        int drawn_arrow_middle_y;
-        int drawn_arrow_end_x;
-        int drawn_arrow_end_y;
-
-        int width;
-        int height;
-
-        GdkGC *gc;
-        GdkPoint *border_points;
-        size_t num_border_points;
-        GdkRegion *window_region;
-
-        guchar urgency;
-        glong timeout;
-        glong remaining;
-
-        UrlClickedCb url_clicked;
+        GtkWidget      *win;
+        GtkWidget      *top_spacer;
+        GtkWidget      *bottom_spacer;
+        GtkWidget      *main_hbox;
+        GtkWidget      *iconbox;
+        GtkWidget      *icon;
+        GtkWidget      *content_hbox;
+        GtkWidget      *summary_label;
+        GtkWidget      *close_button;
+        GtkWidget      *body_label;
+        GtkWidget      *actions_box;
+        GtkWidget      *last_sep;
+        GtkWidget      *stripe_spacer;
+        GtkWidget      *pie_countdown;
+
+        gboolean        has_arrow;
+        gboolean        enable_transparency;
+
+        int             point_x;
+        int             point_y;
+
+        int             drawn_arrow_begin_x;
+        int             drawn_arrow_begin_y;
+        int             drawn_arrow_middle_x;
+        int             drawn_arrow_middle_y;
+        int             drawn_arrow_end_x;
+        int             drawn_arrow_end_y;
+
+        int             width;
+        int             height;
+
+        GdkGC          *gc;
+        GdkPoint       *border_points;
+        size_t          num_border_points;
+        GdkRegion      *window_region;
+
+        guchar          urgency;
+        glong           timeout;
+        glong           remaining;
+
+        UrlClickedCb    url_clicked;
 
 } WindowData;
 
@@ -86,117 +86,134 @@ enum
 # define USE_COMPOSITE
 #endif
 
-
 static void
-fill_background(GtkWidget *widget, WindowData *windata, cairo_t *cr)
+fill_background (GtkWidget *widget,
+                 WindowData *windata,
+                 cairo_t *cr)
 {
-        GtkStyle *style = gtk_widget_get_style(widget);
-        GdkColor *background_color = &style->base[GTK_STATE_NORMAL];
+        GtkStyle        *style;
+        GdkColor        *background_color;
 #ifdef ENABLE_GRADIENT_LOOK
         cairo_pattern_t *gradient;
-        int gradient_y = widget->allocation.height - BOTTOM_GRADIENT_HEIGHT;
+        int              gradient_y;
+
+        gradient_y = widget->allocation.height - BOTTOM_GRADIENT_HEIGHT;
 #endif
 
-        if (windata->enable_transparency)
-        {
-                cairo_set_source_rgba(cr,
-                                                          background_color->red   / 65535.0,
-                                                          background_color->green / 65535.0,
-                                                          background_color->blue  / 65535.0,
-                                                          BACKGROUND_OPACITY);
-        }
-        else
-        {
-                gdk_cairo_set_source_color(cr, background_color);
+        style = gtk_widget_get_style (widget);
+        background_color = &style->base[GTK_STATE_NORMAL];
+
+        if (windata->enable_transparency) {
+                cairo_set_source_rgba (cr,
+                                       background_color->red / 65535.0,
+                                       background_color->green / 65535.0,
+                                       background_color->blue / 65535.0,
+                                       BACKGROUND_OPACITY);
+        } else {
+                gdk_cairo_set_source_color (cr, background_color);
         }
 
-        cairo_rectangle(cr, 0, 0,
-                                        widget->allocation.width,
-                                        widget->allocation.height);
-        cairo_fill(cr);
+        cairo_rectangle (cr,
+                         0,
+                         0,
+                         widget->allocation.width,
+                         widget->allocation.height);
+        cairo_fill (cr);
 
 #ifdef ENABLE_GRADIENT_LOOK
         /* Add a very subtle gradient to the bottom of the notification */
-        gradient = cairo_pattern_create_linear(0, gradient_y, 0,
-                                                                                   widget->allocation.height);
-        cairo_pattern_add_color_stop_rgba(gradient, 0, 0, 0, 0, 0);
-        cairo_pattern_add_color_stop_rgba(gradient, 1, 0, 0, 0, 0.15);
-        cairo_rectangle(cr, 0, gradient_y, widget->allocation.width,
-                                        BOTTOM_GRADIENT_HEIGHT);
-        cairo_set_source(cr, gradient);
-        cairo_fill(cr);
-        cairo_pattern_destroy(gradient);
+        gradient = cairo_pattern_create_linear (0,
+                                                gradient_y,
+                                                0,
+                                                widget->allocation.height);
+        cairo_pattern_add_color_stop_rgba (gradient, 0, 0, 0, 0, 0);
+        cairo_pattern_add_color_stop_rgba (gradient, 1, 0, 0, 0, 0.15);
+        cairo_rectangle (cr,
+                         0,
+                         gradient_y,
+                         widget->allocation.width,
+                         BOTTOM_GRADIENT_HEIGHT);
+        cairo_set_source (cr, gradient);
+        cairo_fill (cr);
+        cairo_pattern_destroy (gradient);
 #endif
 }
 
 static void
-draw_stripe(GtkWidget *widget, WindowData *windata, cairo_t *cr)
+draw_stripe (GtkWidget  *widget,
+             WindowData *windata,
+             cairo_t    *cr)
 {
-        GtkStyle *style = gtk_widget_get_style(widget);
-        GdkColor color;
-        int stripe_x = windata->main_hbox->allocation.x + 1;
-        int stripe_y = windata->main_hbox->allocation.y + 1;
-        int stripe_height = windata->main_hbox->allocation.height - 2;
+        GtkStyle        *style;
+        GdkColor         color;
+        int              stripe_x;
+        int              stripe_y;
+        int              stripe_height;
 #ifdef ENABLE_GRADIENT_LOOK
         cairo_pattern_t *gradient;
-        double r, g, b;
+        double           r, g, b;
 #endif
 
-        switch (windata->urgency)
-        {
-                case URGENCY_LOW: // LOW
-                        color = style->bg[GTK_STATE_NORMAL];
-                        break;
+        style = gtk_widget_get_style (widget);
+        stripe_x = windata->main_hbox->allocation.x + 1;
+        stripe_y = windata->main_hbox->allocation.y + 1;
+        stripe_height = windata->main_hbox->allocation.height - 2;
 
-                case URGENCY_CRITICAL: // CRITICAL
-                        gdk_color_parse("#CC0000", &color);
-                        break;
+        switch (windata->urgency) {
+        case URGENCY_LOW:      // LOW
+                color = style->bg[GTK_STATE_NORMAL];
+                break;
 
-                case URGENCY_NORMAL: // NORMAL
-                default:
-                        color = style->bg[GTK_STATE_SELECTED];
-                        break;
+        case URGENCY_CRITICAL: // CRITICAL
+                gdk_color_parse ("#CC0000", &color);
+                break;
+
+        case URGENCY_NORMAL:   // NORMAL
+        default:
+                color = style->bg[GTK_STATE_SELECTED];
+                break;
         }
 
-        cairo_rectangle(cr, stripe_x, stripe_y, STRIPE_WIDTH, stripe_height);
+        cairo_rectangle (cr, stripe_x, stripe_y, STRIPE_WIDTH, stripe_height);
 
 #ifdef ENABLE_GRADIENT_LOOK
-        r = color.red   / 65535.0;
+        r = color.red / 65535.0;
         g = color.green / 65535.0;
-        b = color.blue  / 65535.0;
-
-        gradient = cairo_pattern_create_linear(stripe_x, 0, STRIPE_WIDTH, 0);
-        cairo_pattern_add_color_stop_rgba(gradient, 0, r, g, b, 1);
-        cairo_pattern_add_color_stop_rgba(gradient, 1, r, g, b, 0);
-        cairo_set_source(cr, gradient);
-        cairo_fill(cr);
-        cairo_pattern_destroy(gradient);
+        b = color.blue / 65535.0;
+
+        gradient = cairo_pattern_create_linear (stripe_x, 0, STRIPE_WIDTH, 0);
+        cairo_pattern_add_color_stop_rgba (gradient, 0, r, g, b, 1);
+        cairo_pattern_add_color_stop_rgba (gradient, 1, r, g, b, 0);
+        cairo_set_source (cr, gradient);
+        cairo_fill (cr);
+        cairo_pattern_destroy (gradient);
 #else
-        gdk_cairo_set_source_color(cr, &color);
-        cairo_fill(cr);
+        gdk_cairo_set_source_color (cr, &color);
+        cairo_fill (cr);
 #endif
 }
 
 static GtkArrowType
-get_notification_arrow_type(GtkWidget *nw)
+get_notification_arrow_type (GtkWidget *nw)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        GdkScreen *screen;
-        GdkRectangle monitor_geometry;
-        int monitor;
-
-        screen = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
-        monitor = gdk_screen_get_monitor_at_point(screen, windata->point_x,
-                                                                                          windata->point_y);
-        gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry);
-
-        if (windata->point_y - monitor_geometry.y + windata->height +
-                DEFAULT_ARROW_HEIGHT > monitor_geometry.height)
-        {
+        WindowData     *windata;
+        GdkScreen      *screen;
+        GdkRectangle    monitor_geometry;
+        int             monitor;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+
+        screen = gdk_drawable_get_screen (GDK_DRAWABLE (nw->window));
+        monitor = gdk_screen_get_monitor_at_point (screen,
+                                                   windata->point_x,
+                                                   windata->point_y);
+        gdk_screen_get_monitor_geometry (screen, monitor, &monitor_geometry);
+
+        if (windata->point_y - monitor_geometry.y
+            + windata->height + DEFAULT_ARROW_HEIGHT
+            > monitor_geometry.height) {
                 return GTK_ARROW_DOWN;
-        }
-        else
-        {
+        } else {
                 return GTK_ARROW_UP;
         }
 }
@@ -211,419 +228,404 @@ get_notification_arrow_type(GtkWidget *nw)
         } G_STMT_END
 
 static void
-create_border_with_arrow(GtkWidget *nw, WindowData *windata)
+create_border_with_arrow (GtkWidget  *nw,
+                          WindowData *windata)
 {
-        int width;
-        int height;
-        int y;
-        int norm_point_x;
-        int norm_point_y;
-        GtkArrowType arrow_type;
-        GdkScreen *screen;
-        int arrow_side1_width = DEFAULT_ARROW_WIDTH / 2;
-        int arrow_side2_width = DEFAULT_ARROW_WIDTH / 2;
-        int arrow_offset = DEFAULT_ARROW_OFFSET;
-        GdkPoint *shape_points = NULL;
-        int i = 0;
-        int monitor;
-        GdkRectangle monitor_geometry;
-
-        width  = windata->width;
+        int             width;
+        int             height;
+        int             y;
+        int             norm_point_x;
+        int             norm_point_y;
+        GtkArrowType    arrow_type;
+        GdkScreen      *screen;
+        int             arrow_side1_width = DEFAULT_ARROW_WIDTH / 2;
+        int             arrow_side2_width = DEFAULT_ARROW_WIDTH / 2;
+        int             arrow_offset = DEFAULT_ARROW_OFFSET;
+        GdkPoint       *shape_points = NULL;
+        int             i = 0;
+        int             monitor;
+        GdkRectangle    monitor_geometry;
+
+        width = windata->width;
         height = windata->height;
 
-        screen  = gdk_drawable_get_screen(GDK_DRAWABLE(nw->window));
-        monitor = gdk_screen_get_monitor_at_point(screen,
-                                                                                          windata->point_x,
-                                                                                          windata->point_y);
-        gdk_screen_get_monitor_geometry(screen, monitor, &monitor_geometry);
+        screen = gdk_drawable_get_screen (GDK_DRAWABLE (nw->window));
+        monitor = gdk_screen_get_monitor_at_point (screen,
+                                                   windata->point_x,
+                                                   windata->point_y);
+        gdk_screen_get_monitor_geometry (screen, monitor, &monitor_geometry);
 
         windata->num_border_points = 5;
 
-        arrow_type = get_notification_arrow_type(windata->win);
+        arrow_type = get_notification_arrow_type (windata->win);
 
         norm_point_x = windata->point_x - monitor_geometry.x;
         norm_point_y = windata->point_y - monitor_geometry.y;
 
         /* Handle the offset and such */
-        switch (arrow_type)
-        {
-                case GTK_ARROW_UP:
-                case GTK_ARROW_DOWN:
-                        if (norm_point_x < arrow_side1_width)
-                        {
-                                arrow_side1_width = 0;
-                                arrow_offset = 0;
-                        }
-                        else if (norm_point_x > monitor_geometry.width - arrow_side2_width)
-                        {
-                                arrow_side2_width = 0;
-                                arrow_offset = width - arrow_side1_width;
+        switch (arrow_type) {
+        case GTK_ARROW_UP:
+        case GTK_ARROW_DOWN:
+                if (norm_point_x < arrow_side1_width) {
+                        arrow_side1_width = 0;
+                        arrow_offset = 0;
+                } else if (norm_point_x > monitor_geometry.width - arrow_side2_width) {
+                        arrow_side2_width = 0;
+                        arrow_offset = width - arrow_side1_width;
+                } else {
+                        if (norm_point_x - arrow_side2_width + width >=
+                            monitor_geometry.width) {
+                                arrow_offset = width - monitor_geometry.width + norm_point_x;
+                        } else {
+                                arrow_offset = MIN (norm_point_x - arrow_side1_width,
+                                                    DEFAULT_ARROW_OFFSET);
                         }
-                        else
-                        {
-                                if (norm_point_x - arrow_side2_width + width >=
-                                        monitor_geometry.width)
-                                {
-                                        arrow_offset = width - monitor_geometry.width +
-                                                           norm_point_x;
-                                }
-                                else
-                                {
-                                        arrow_offset = MIN(norm_point_x - arrow_side1_width,
-                                                                           DEFAULT_ARROW_OFFSET);
-                                }
 
-                                if (arrow_offset == 0 ||
-                                        arrow_offset == width - arrow_side1_width)
-                                {
-                                        windata->num_border_points++;
-                                }
-                                else
-                                        windata->num_border_points += 2;
-                        }
+                        if (arrow_offset == 0 ||
+                            arrow_offset == width - arrow_side1_width) {
+                                windata->num_border_points++;
+                        } else
+                                windata->num_border_points += 2;
+                }
 
-                        /*
-                         * Why risk this for official builds? If it's somehow off the
-                         * screen, it won't horribly impact the user. Definitely less
-                         * than an assertion would...
-                         */
+                /*
+                 * Why risk this for official builds? If it's somehow off the
+                 * screen, it won't horribly impact the user. Definitely less
+                 * than an assertion would...
+                 */
 #if 0
-                        g_assert(arrow_offset + arrow_side1_width >= 0);
-                        g_assert(arrow_offset + arrow_side1_width + arrow_side2_width <=
-                                         width);
+                g_assert (arrow_offset + arrow_side1_width >= 0);
+                g_assert (arrow_offset + arrow_side1_width +
+                          arrow_side2_width <= width);
 #endif
 
-                        windata->border_points = g_new0(GdkPoint,
-                                                                                        windata->num_border_points);
-                        shape_points = g_new0(GdkPoint, windata->num_border_points);
-
-                        windata->drawn_arrow_begin_x = arrow_offset;
-                        windata->drawn_arrow_middle_x = arrow_offset + arrow_side1_width;
-                        windata->drawn_arrow_end_x = arrow_offset + arrow_side1_width +
-                                                                                 arrow_side2_width;
-                        if (arrow_type == GTK_ARROW_UP)
-                        {
-                                windata->drawn_arrow_begin_y = DEFAULT_ARROW_HEIGHT;
-                                windata->drawn_arrow_middle_y = 0;
-                                windata->drawn_arrow_end_y = DEFAULT_ARROW_HEIGHT;
-
-                                if (arrow_side1_width == 0)
-                                {
-                                        ADD_POINT(0, 0, 0, 0);
-                                }
-                                else
-                                {
-                                        ADD_POINT(0, DEFAULT_ARROW_HEIGHT, 0, 0);
-
-                                        if (arrow_offset > 0)
-                                        {
-                                                ADD_POINT(arrow_offset -
-                                                                  (arrow_side2_width > 0 ? 0 : 1),
-                                                                  DEFAULT_ARROW_HEIGHT, 0, 0);
-                                        }
-
-                                        ADD_POINT(arrow_offset + arrow_side1_width -
-                                                          (arrow_side2_width > 0 ? 0 : 1),
-                                                          0, 0, 0);
+                windata->border_points = g_new0 (GdkPoint,
+                                                 windata->num_border_points);
+                shape_points = g_new0 (GdkPoint, windata->num_border_points);
+
+                windata->drawn_arrow_begin_x = arrow_offset;
+                windata->drawn_arrow_middle_x = arrow_offset + arrow_side1_width;
+                windata->drawn_arrow_end_x = arrow_offset + arrow_side1_width + arrow_side2_width;
+                if (arrow_type == GTK_ARROW_UP) {
+                        windata->drawn_arrow_begin_y = DEFAULT_ARROW_HEIGHT;
+                        windata->drawn_arrow_middle_y = 0;
+                        windata->drawn_arrow_end_y = DEFAULT_ARROW_HEIGHT;
+
+                        if (arrow_side1_width == 0) {
+                                ADD_POINT (0, 0, 0, 0);
+                        } else {
+                                ADD_POINT (0, DEFAULT_ARROW_HEIGHT, 0, 0);
+
+                                if (arrow_offset > 0) {
+                                        ADD_POINT (arrow_offset - (arrow_side2_width > 0 ? 0 : 1),
+                                                   DEFAULT_ARROW_HEIGHT, 0,
+                                                   0);
                                 }
 
-                                if (arrow_side2_width > 0)
-                                {
-                                        ADD_POINT(windata->drawn_arrow_end_x,
-                                                          windata->drawn_arrow_end_y, 1, 0);
-                                        ADD_POINT(width - 1, DEFAULT_ARROW_HEIGHT, 1, 0);
-                                }
-
-                                ADD_POINT(width - 1, height - 1, 1, 1);
-                                ADD_POINT(0, height - 1, 0, 1);
+                                ADD_POINT (arrow_offset + arrow_side1_width - (arrow_side2_width > 0 ? 0 : 1),
+                                           0, 0, 0);
+                        }
 
-                                y = windata->point_y;
+                        if (arrow_side2_width > 0) {
+                                ADD_POINT (windata->drawn_arrow_end_x,
+                                           windata->drawn_arrow_end_y, 1, 0);
+                                ADD_POINT (width - 1, DEFAULT_ARROW_HEIGHT, 1,
+                                           0);
                         }
-                        else
-                        {
-                                windata->drawn_arrow_begin_y = height - DEFAULT_ARROW_HEIGHT;
-                                windata->drawn_arrow_middle_y = height;
-                                windata->drawn_arrow_end_y = height - DEFAULT_ARROW_HEIGHT;
-
-                                ADD_POINT(0, 0, 0, 0);
-                                ADD_POINT(width - 1, 0, 1, 0);
-
-                                if (arrow_side2_width == 0)
-                                {
-                                        ADD_POINT(width - 1, height,
-                                                          (arrow_side1_width > 0 ? 0 : 1), 0);
-                                }
-                                else
-                                {
-                                        ADD_POINT(width - 1, height - DEFAULT_ARROW_HEIGHT, 1, 1);
-
-                                        if (arrow_offset < width - arrow_side1_width)
-                                        {
-                                                ADD_POINT(arrow_offset + arrow_side1_width +
-                                                                  arrow_side2_width,
-                                                                  height - DEFAULT_ARROW_HEIGHT, 0, 1);
-                                        }
-
-                                        ADD_POINT(arrow_offset + arrow_side1_width, height, 0, 1);
-                                }
 
-                                if (arrow_side1_width > 0)
-                                {
-                                        ADD_POINT(windata->drawn_arrow_begin_x -
-                                                          (arrow_side2_width > 0 ? 0 : 1),
-                                                          windata->drawn_arrow_begin_y, 0, 0);
-                                        ADD_POINT(0, height - DEFAULT_ARROW_HEIGHT, 0, 1);
+                        ADD_POINT (width - 1, height - 1, 1, 1);
+                        ADD_POINT (0, height - 1, 0, 1);
+
+                        y = windata->point_y;
+                } else {
+                        windata->drawn_arrow_begin_y = height - DEFAULT_ARROW_HEIGHT;
+                        windata->drawn_arrow_middle_y = height;
+                        windata->drawn_arrow_end_y = height - DEFAULT_ARROW_HEIGHT;
+
+                        ADD_POINT (0, 0, 0, 0);
+                        ADD_POINT (width - 1, 0, 1, 0);
+
+                        if (arrow_side2_width == 0) {
+                                ADD_POINT (width - 1, height,
+                                           (arrow_side1_width > 0 ? 0 : 1),
+                                           0);
+                        } else {
+                                ADD_POINT (width - 1,
+                                           height - DEFAULT_ARROW_HEIGHT, 1,
+                                           1);
+
+                                if (arrow_offset < width - arrow_side1_width) {
+                                        ADD_POINT (arrow_offset +
+                                                   arrow_side1_width +
+                                                   arrow_side2_width,
+                                                   height -
+                                                   DEFAULT_ARROW_HEIGHT, 0,
+                                                   1);
                                 }
 
-                                y = windata->point_y - height;
+                                ADD_POINT (arrow_offset + arrow_side1_width,
+                                           height, 0, 1);
                         }
 
-#if 0
-                        g_assert(i == windata->num_border_points);
-                        g_assert(windata->point_x - arrow_offset - arrow_side1_width >= 0);
-#endif
-                        gtk_window_move(GTK_WINDOW(windata->win),
-                                                        windata->point_x - arrow_offset -
-                                                        arrow_side1_width,
-                                                        y);
+                        if (arrow_side1_width > 0) {
+                                ADD_POINT (windata->drawn_arrow_begin_x - (arrow_side2_width > 0 ? 0 : 1),
+                                           windata->drawn_arrow_begin_y, 0,
+                                           0);
+                                ADD_POINT (0, height - DEFAULT_ARROW_HEIGHT,
+                                           0, 1);
+                        }
 
-                        break;
+                        y = windata->point_y - height;
+                }
 
-                case GTK_ARROW_LEFT:
-                case GTK_ARROW_RIGHT:
-                        if (norm_point_y < arrow_side1_width)
-                        {
-                                arrow_side1_width = 0;
-                                arrow_offset = norm_point_y;
-                        }
-                        else if (norm_point_y > monitor_geometry.height - arrow_side2_width)
-                        {
-                                arrow_side2_width = 0;
-                                arrow_offset = norm_point_y - arrow_side1_width;
-                        }
-                        break;
+#if 0
+                g_assert (i == windata->num_border_points);
+                g_assert (windata->point_x - arrow_offset - arrow_side1_width >= 0);
+#endif
+                gtk_window_move (GTK_WINDOW (windata->win),
+                                 windata->point_x - arrow_offset - arrow_side1_width,
+                                 y);
+
+                break;
+
+        case GTK_ARROW_LEFT:
+        case GTK_ARROW_RIGHT:
+                if (norm_point_y < arrow_side1_width) {
+                        arrow_side1_width = 0;
+                        arrow_offset = norm_point_y;
+                } else if (norm_point_y >
+                           monitor_geometry.height - arrow_side2_width) {
+                        arrow_side2_width = 0;
+                        arrow_offset = norm_point_y - arrow_side1_width;
+                }
+                break;
 
-                default:
-                        g_assert_not_reached();
+        default:
+                g_assert_not_reached ();
         }
 
-        g_assert(shape_points != NULL);
+        g_assert (shape_points != NULL);
 
         windata->window_region =
-                gdk_region_polygon(shape_points, windata->num_border_points,
-                                                   GDK_EVEN_ODD_RULE);
-        g_free(shape_points);
+                gdk_region_polygon (shape_points,
+                                    windata->num_border_points,
+                                    GDK_EVEN_ODD_RULE);
+        g_free (shape_points);
 }
 
 static void
-draw_border(GtkWidget *widget, WindowData *windata, cairo_t *cr)
+draw_border (GtkWidget  *widget,
+             WindowData *windata,
+             cairo_t    *cr)
 {
-        cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0);
-        cairo_set_line_width(cr, 1.0);
+        cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
+        cairo_set_line_width (cr, 1.0);
 
-        if (windata->has_arrow)
-        {
+        if (windata->has_arrow) {
                 int i;
 
-                create_border_with_arrow(windata->win, windata);
+                create_border_with_arrow (windata->win, windata);
 
-                cairo_move_to(cr,
-                                          windata->border_points[0].x + 0.5,
-                                          windata->border_points[0].y + 0.5);
+                cairo_move_to (cr,
+                               windata->border_points[0].x + 0.5,
+                               windata->border_points[0].y + 0.5);
 
-                for (i = 1; i < windata->num_border_points; i++)
-                {
-                        cairo_line_to(cr,
-                                                  windata->border_points[i].x + 0.5,
-                                                  windata->border_points[i].y + 0.5);
+                for (i = 1; i < windata->num_border_points; i++) {
+                        cairo_line_to (cr,
+                                       windata->border_points[i].x + 0.5,
+                                       windata->border_points[i].y + 0.5);
                 }
 
-                cairo_close_path(cr);
-                gdk_window_shape_combine_region(windata->win->window,
-                                                                                windata->window_region, 0, 0);
-                g_free(windata->border_points);
+                cairo_close_path (cr);
+                gdk_window_shape_combine_region (windata->win->window,
+                                                 windata->window_region, 0,
+                                                 0);
+                g_free (windata->border_points);
                 windata->border_points = NULL;
-        }
-        else
-        {
-                cairo_rectangle(cr, 0.5, 0.5,
-                                                windata->width - 0.5, windata->height - 0.5);
+        } else {
+                cairo_rectangle (cr,
+                                 0.5,
+                                 0.5,
+                                 windata->width - 0.5,
+                                 windata->height - 0.5);
         }
 
-        cairo_stroke(cr);
+        cairo_stroke (cr);
 }
 
 static gboolean
-paint_window(GtkWidget *widget,
-                         GdkEventExpose *event,
-                         WindowData *windata)
+paint_window (GtkWidget      *widget,
+              GdkEventExpose *event,
+              WindowData     *windata)
 {
-        cairo_t *context;
+        cairo_t         *context;
         cairo_surface_t *surface;
-        cairo_t *cr;
+        cairo_t         *cr;
 
         if (windata->width == 0) {
                 windata->width = windata->win->allocation.width;
                 windata->height = windata->win->allocation.height;
         }
 
-        context = gdk_cairo_create(widget->window);
+        context = gdk_cairo_create (widget->window);
 
-        cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
-        surface = cairo_surface_create_similar(cairo_get_target(context),
-                                                                                   CAIRO_CONTENT_COLOR_ALPHA,
-                                                                                   widget->allocation.width,
-                                                                                   widget->allocation.height);
-        cr = cairo_create(surface);
+        cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
+        surface = cairo_surface_create_similar (cairo_get_target (context),
+                                                CAIRO_CONTENT_COLOR_ALPHA,
+                                                widget->allocation.width,
+                                                widget->allocation.height);
+        cr = cairo_create (surface);
 
-        fill_background(widget, windata, cr);
-        draw_border(widget, windata, cr);
-        draw_stripe(widget, windata, cr);
+        fill_background (widget, windata, cr);
+        draw_border (widget, windata, cr);
+        draw_stripe (widget, windata, cr);
 
-        cairo_destroy(cr);
-        cairo_set_source_surface(context, surface, 0, 0);
-        cairo_paint(context);
-        cairo_surface_destroy(surface);
-        cairo_destroy(context);
+        cairo_destroy (cr);
+        cairo_set_source_surface (context, surface, 0, 0);
+        cairo_paint (context);
+        cairo_surface_destroy (surface);
+        cairo_destroy (context);
 
         return FALSE;
 }
 
 static void
-destroy_windata(WindowData *windata)
+destroy_windata (WindowData *windata)
 {
         if (windata->gc != NULL)
-                g_object_unref(G_OBJECT(windata->gc));
+                g_object_unref (G_OBJECT (windata->gc));
 
         if (windata->window_region != NULL)
-                gdk_region_destroy(windata->window_region);
+                gdk_region_destroy (windata->window_region);
 
-        g_free(windata);
+        g_free (windata);
 }
 
 static void
-update_spacers(GtkWidget *nw)
+update_spacers (GtkWidget *nw)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-
-        if (windata->has_arrow)
-        {
-                switch (get_notification_arrow_type(GTK_WIDGET(nw)))
-                {
-                        case GTK_ARROW_UP:
-                                gtk_widget_show(windata->top_spacer);
-                                gtk_widget_hide(windata->bottom_spacer);
-                                break;
-
-                        case GTK_ARROW_DOWN:
-                                gtk_widget_hide(windata->top_spacer);
-                                gtk_widget_show(windata->bottom_spacer);
-                                break;
-
-                        default:
-                                g_assert_not_reached();
+        WindowData     *windata;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+
+        if (windata->has_arrow) {
+                switch (get_notification_arrow_type (GTK_WIDGET (nw))) {
+                case GTK_ARROW_UP:
+                        gtk_widget_show (windata->top_spacer);
+                        gtk_widget_hide (windata->bottom_spacer);
+                        break;
+
+                case GTK_ARROW_DOWN:
+                        gtk_widget_hide (windata->top_spacer);
+                        gtk_widget_show (windata->bottom_spacer);
+                        break;
+
+                default:
+                        g_assert_not_reached ();
                 }
-        }
-        else
-        {
-                gtk_widget_hide(windata->top_spacer);
-                gtk_widget_hide(windata->bottom_spacer);
+        } else {
+                gtk_widget_hide (windata->top_spacer);
+                gtk_widget_hide (windata->bottom_spacer);
         }
 }
 
 static void
-update_content_hbox_visibility(WindowData *windata)
+update_content_hbox_visibility (WindowData *windata)
 {
         /*
          * This is all a hack, but until we have a libview-style ContentBox,
          * it'll just have to do.
          */
-        if (GTK_WIDGET_VISIBLE(windata->icon) ||
-                GTK_WIDGET_VISIBLE(windata->body_label) ||
-                GTK_WIDGET_VISIBLE(windata->actions_box))
-        {
-                gtk_widget_show(windata->content_hbox);
-        }
-        else
-        {
-                gtk_widget_hide(windata->content_hbox);
+        if (GTK_WIDGET_VISIBLE (windata->icon)
+            || GTK_WIDGET_VISIBLE (windata->body_label)
+            || GTK_WIDGET_VISIBLE (windata->actions_box)) {
+                gtk_widget_show (windata->content_hbox);
+        } else {
+                gtk_widget_hide (windata->content_hbox);
         }
 }
 
 static gboolean
-configure_event_cb(GtkWidget *nw,
-                                   GdkEventConfigure *event,
-                                   WindowData *windata)
+configure_event_cb (GtkWidget         *nw,
+                    GdkEventConfigure *event,
+                    WindowData        *windata)
 {
         windata->width = event->width;
         windata->height = event->height;
 
-        update_spacers(nw);
-        gtk_widget_queue_draw(nw);
+        update_spacers (nw);
+        gtk_widget_queue_draw (nw);
 
         return FALSE;
 }
 
 static gboolean
-activate_link (GtkLabel *label, const char *url, WindowData *windata)
+activate_link (GtkLabel   *label,
+               const char *url,
+               WindowData *windata)
 {
-        windata->url_clicked (GTK_WINDOW(windata->win), url);
+        windata->url_clicked (GTK_WINDOW (windata->win), url);
 
         return TRUE;
 }
 
 GtkWindow *
-create_notification(UrlClickedCb url_clicked)
+create_notification (UrlClickedCb url_clicked)
 {
-        GtkWidget *spacer;
-        GtkWidget *win;
-        GtkWidget *drawbox;
-        GtkWidget *main_vbox;
-        GtkWidget *hbox;
-        GtkWidget *vbox;
-        GtkWidget *close_button;
-        GtkWidget *image;
-        GtkWidget *alignment;
-        AtkObject *atkobj;
-        GtkRcStyle *rcstyle;
-        WindowData *windata;
+        GtkWidget      *spacer;
+        GtkWidget      *win;
+        GtkWidget      *drawbox;
+        GtkWidget      *main_vbox;
+        GtkWidget      *hbox;
+        GtkWidget      *vbox;
+        GtkWidget      *close_button;
+        GtkWidget      *image;
+        GtkWidget      *alignment;
+        AtkObject      *atkobj;
+        GtkRcStyle     *rcstyle;
+        WindowData     *windata;
 #ifdef USE_COMPOSITE
-        GdkColormap *colormap;
-        GdkScreen *screen;
+        GdkColormap    *colormap;
+        GdkScreen      *screen;
 #endif
 
-        windata = g_new0(WindowData, 1);
+        windata = g_new0 (WindowData, 1);
         windata->urgency = URGENCY_NORMAL;
         windata->url_clicked = url_clicked;
 
-        win = gtk_window_new(GTK_WINDOW_POPUP);
+        win = gtk_window_new (GTK_WINDOW_POPUP);
         windata->win = win;
 
         windata->enable_transparency = FALSE;
 #ifdef USE_COMPOSITE
-        screen = gtk_window_get_screen(GTK_WINDOW(win));
-        colormap = gdk_screen_get_rgba_colormap(screen);
+        screen = gtk_window_get_screen (GTK_WINDOW (win));
+        colormap = gdk_screen_get_rgba_colormap (screen);
 
-        if (colormap != NULL && gdk_screen_is_composited(screen))
-        {
-                gtk_widget_set_colormap(win, colormap);
+        if (colormap != NULL && gdk_screen_is_composited (screen)) {
+                gtk_widget_set_colormap (win, colormap);
                 windata->enable_transparency = TRUE;
         }
 #endif
 
-        gtk_window_set_title(GTK_WINDOW(win), "Notification");
-        gtk_window_set_type_hint(GTK_WINDOW(win),
-                                                         GDK_WINDOW_TYPE_HINT_NOTIFICATION);
-        gtk_widget_add_events(win, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
-        gtk_widget_realize(win);
-        gtk_widget_set_size_request(win, WIDTH, -1);
-
-        g_object_set_data_full(G_OBJECT(win), "windata", windata,
-                                                   (GDestroyNotify)destroy_windata);
-        atk_object_set_role(gtk_widget_get_accessible(win), ATK_ROLE_ALERT);
-
-        g_signal_connect(G_OBJECT(win), "configure_event",
-                                         G_CALLBACK(configure_event_cb), windata);
+        gtk_window_set_title (GTK_WINDOW (win), "Notification");
+        gtk_window_set_type_hint (GTK_WINDOW (win),
+                                  GDK_WINDOW_TYPE_HINT_NOTIFICATION);
+        gtk_widget_add_events (win,
+                               GDK_BUTTON_PRESS_MASK
+                               | GDK_BUTTON_RELEASE_MASK);
+        gtk_widget_realize (win);
+        gtk_widget_set_size_request (win, WIDTH, -1);
+
+        g_object_set_data_full (G_OBJECT (win),
+                                "windata",
+                                windata,
+                                (GDestroyNotify) destroy_windata);
+        atk_object_set_role (gtk_widget_get_accessible (win), ATK_ROLE_ALERT);
+
+        g_signal_connect (G_OBJECT (win),
+                          "configure_event",
+                          G_CALLBACK (configure_event_cb),
+                          windata);
 
         /*
          * For some reason, there are occasionally graphics glitches when
@@ -632,425 +634,515 @@ create_notification(UrlClickedCb url_clicked)
          * notifications will appear on the notification. Somehow, adding this
          * eventbox makes that problem just go away. Whatever works for now.
          */
-        drawbox = gtk_event_box_new();
-        gtk_widget_show(drawbox);
-        gtk_container_add(GTK_CONTAINER(win), drawbox);
-
-        main_vbox = gtk_vbox_new(FALSE, 0);
-        gtk_widget_show(main_vbox);
-        gtk_container_add(GTK_CONTAINER(drawbox), main_vbox);
-        gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 1);
-
-        g_signal_connect(G_OBJECT(main_vbox), "expose_event",
-                                         G_CALLBACK(paint_window), windata);
-
-        windata->top_spacer = gtk_image_new();
-        gtk_box_pack_start(GTK_BOX(main_vbox), windata->top_spacer,
-                                           FALSE, FALSE, 0);
-        gtk_widget_set_size_request(windata->top_spacer, -1, DEFAULT_ARROW_HEIGHT);
-
-        windata->main_hbox = gtk_hbox_new(FALSE, 0);
-        gtk_widget_show(windata->main_hbox);
-        gtk_box_pack_start(GTK_BOX(main_vbox), windata->main_hbox,
-                                           FALSE, FALSE, 0);
-
-        windata->bottom_spacer = gtk_image_new();
-        gtk_box_pack_start(GTK_BOX(main_vbox), windata->bottom_spacer,
-                                           FALSE, FALSE, 0);
-        gtk_widget_set_size_request(windata->bottom_spacer, -1,
-                                                                DEFAULT_ARROW_HEIGHT);
-
-        vbox = gtk_vbox_new(FALSE, 6);
-        gtk_widget_show(vbox);
-        gtk_box_pack_start(GTK_BOX(windata->main_hbox), vbox, TRUE, TRUE, 0);
-        gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
-
-        hbox = gtk_hbox_new(FALSE, 6);
-        gtk_widget_show(hbox);
-        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
-        spacer = gtk_image_new();
-        gtk_widget_show(spacer);
-        gtk_box_pack_start(GTK_BOX(hbox), spacer, FALSE, FALSE, 0);
-        gtk_widget_set_size_request(spacer, SPACER_LEFT, -1);
-
-        windata->summary_label = gtk_label_new(NULL);
-        gtk_widget_show(windata->summary_label);
-        gtk_box_pack_start(GTK_BOX(hbox), windata->summary_label, TRUE, TRUE, 0);
-        gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0);
-        gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE);
-
-        atkobj = gtk_widget_get_accessible(windata->summary_label);
-        atk_object_set_description(atkobj, "Notification summary text.");
+        drawbox = gtk_event_box_new ();
+        gtk_widget_show (drawbox);
+        gtk_container_add (GTK_CONTAINER (win), drawbox);
+
+        main_vbox = gtk_vbox_new (FALSE, 0);
+        gtk_widget_show (main_vbox);
+        gtk_container_add (GTK_CONTAINER (drawbox), main_vbox);
+        gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 1);
+
+        g_signal_connect (G_OBJECT (main_vbox),
+                          "expose_event",
+                          G_CALLBACK (paint_window),
+                          windata);
+
+        windata->top_spacer = gtk_image_new ();
+        gtk_box_pack_start (GTK_BOX (main_vbox),
+                            windata->top_spacer,
+                            FALSE,
+                            FALSE,
+                            0);
+        gtk_widget_set_size_request (windata->top_spacer,
+                                     -1,
+                                     DEFAULT_ARROW_HEIGHT);
+
+        windata->main_hbox = gtk_hbox_new (FALSE, 0);
+        gtk_widget_show (windata->main_hbox);
+        gtk_box_pack_start (GTK_BOX (main_vbox),
+                            windata->main_hbox,
+                            FALSE,
+                            FALSE,
+                            0);
+
+        windata->bottom_spacer = gtk_image_new ();
+        gtk_box_pack_start (GTK_BOX (main_vbox),
+                            windata->bottom_spacer,
+                            FALSE,
+                            FALSE,
+                            0);
+        gtk_widget_set_size_request (windata->bottom_spacer,
+                                     -1,
+                                     DEFAULT_ARROW_HEIGHT);
+
+        vbox = gtk_vbox_new (FALSE, 6);
+        gtk_widget_show (vbox);
+        gtk_box_pack_start (GTK_BOX (windata->main_hbox),
+                            vbox,
+                            TRUE,
+                            TRUE,
+                            0);
+        gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
+
+        hbox = gtk_hbox_new (FALSE, 6);
+        gtk_widget_show (hbox);
+        gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+
+        spacer = gtk_image_new ();
+        gtk_widget_show (spacer);
+        gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
+        gtk_widget_set_size_request (spacer, SPACER_LEFT, -1);
+
+        windata->summary_label = gtk_label_new (NULL);
+        gtk_widget_show (windata->summary_label);
+        gtk_box_pack_start (GTK_BOX (hbox),
+                            windata->summary_label,
+                            TRUE,
+                            TRUE, 0);
+        gtk_misc_set_alignment (GTK_MISC (windata->summary_label), 0, 0);
+        gtk_label_set_line_wrap (GTK_LABEL (windata->summary_label), TRUE);
+
+        atkobj = gtk_widget_get_accessible (windata->summary_label);
+        atk_object_set_description (atkobj, "Notification summary text.");
 
         /* Add the close button */
-        alignment = gtk_alignment_new(1, 0, 0, 0);
-        gtk_widget_show(alignment);
-        gtk_box_pack_start(GTK_BOX(hbox), alignment, FALSE, FALSE, 0);
+        alignment = gtk_alignment_new (1, 0, 0, 0);
+        gtk_widget_show (alignment);
+        gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, FALSE, 0);
 
-        close_button = gtk_button_new();
+        close_button = gtk_button_new ();
         windata->close_button = close_button;
-        gtk_widget_show(close_button);
-        gtk_container_add(GTK_CONTAINER(alignment), close_button);
-        gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE);
-        gtk_container_set_border_width(GTK_CONTAINER(close_button), 0);
+        gtk_widget_show (close_button);
+        gtk_container_add (GTK_CONTAINER (alignment), close_button);
+        gtk_button_set_relief (GTK_BUTTON (close_button), GTK_RELIEF_NONE);
+        gtk_container_set_border_width (GTK_CONTAINER (close_button), 0);
         //gtk_widget_set_size_request(close_button, 20, 20);
-        g_signal_connect_swapped(G_OBJECT(close_button), "clicked",
-                                                         G_CALLBACK(gtk_widget_destroy), win);
+        g_signal_connect_swapped (G_OBJECT (close_button),
+                                  "clicked",
+                                  G_CALLBACK (gtk_widget_destroy),
+                                  win);
 
-        rcstyle = gtk_rc_style_new();
+        rcstyle = gtk_rc_style_new ();
         rcstyle->xthickness = rcstyle->ythickness = 0;
-        gtk_widget_modify_style(close_button, rcstyle);
-        g_object_unref(rcstyle);
-
-        atkobj = gtk_widget_get_accessible(close_button);
-        atk_action_set_description(ATK_ACTION(atkobj), 0,
-                                                           "Closes the notification.");
-        atk_object_set_name(atkobj, "");
-        atk_object_set_description(atkobj, "Closes the notification.");
-
-        image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
-        gtk_widget_show(image);
-        gtk_container_add(GTK_CONTAINER(close_button), image);
-
-        windata->content_hbox = gtk_hbox_new(FALSE, 6);
-        gtk_box_pack_start(GTK_BOX(vbox), windata->content_hbox, FALSE, FALSE, 0);
-
-        windata->iconbox = gtk_hbox_new(FALSE, 0);
-        gtk_widget_show(windata->iconbox);
-        gtk_box_pack_start(GTK_BOX(windata->content_hbox), windata->iconbox,
-                                           FALSE, FALSE, 0);
-        gtk_widget_set_size_request(windata->iconbox, BODY_X_OFFSET, -1);
-
-        windata->icon = gtk_image_new();
-        gtk_box_pack_start(GTK_BOX(windata->iconbox), windata->icon,
-                                           TRUE, TRUE, 0);
-        gtk_misc_set_alignment(GTK_MISC(windata->icon), 0.5, 0.0);
-
-        vbox = gtk_vbox_new(FALSE, 6);
-        gtk_widget_show(vbox);
-        gtk_box_pack_start(GTK_BOX(windata->content_hbox), vbox, TRUE, TRUE, 0);
+        gtk_widget_modify_style (close_button, rcstyle);
+        g_object_unref (rcstyle);
+
+        atkobj = gtk_widget_get_accessible (close_button);
+        atk_action_set_description (ATK_ACTION (atkobj), 0,
+                                    "Closes the notification.");
+        atk_object_set_name (atkobj, "");
+        atk_object_set_description (atkobj, "Closes the notification.");
+
+        image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
+                                          GTK_ICON_SIZE_MENU);
+        gtk_widget_show (image);
+        gtk_container_add (GTK_CONTAINER (close_button), image);
+
+        windata->content_hbox = gtk_hbox_new (FALSE, 6);
+        gtk_box_pack_start (GTK_BOX (vbox),
+                            windata->content_hbox,
+                            FALSE,
+                            FALSE,
+                            0);
+
+        windata->iconbox = gtk_hbox_new (FALSE, 0);
+        gtk_widget_show (windata->iconbox);
+        gtk_box_pack_start (GTK_BOX (windata->content_hbox),
+                            windata->iconbox,
+                            FALSE,
+                            FALSE,
+                            0);
+        gtk_widget_set_size_request (windata->iconbox, BODY_X_OFFSET, -1);
+
+        windata->icon = gtk_image_new ();
+        gtk_box_pack_start (GTK_BOX (windata->iconbox),
+                            windata->icon,
+                            TRUE,
+                            TRUE,
+                            0);
+        gtk_misc_set_alignment (GTK_MISC (windata->icon), 0.5, 0.0);
+
+        vbox = gtk_vbox_new (FALSE, 6);
+        gtk_widget_show (vbox);
+        gtk_box_pack_start (GTK_BOX (windata->content_hbox),
+                            vbox,
+                            TRUE,
+                            TRUE,
+                            0);
 
         windata->body_label = gtk_label_new (NULL);
-        gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0);
-        gtk_misc_set_alignment(GTK_MISC(windata->body_label), 0, 0);
-        gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE);
-        g_signal_connect(G_OBJECT(windata->body_label), "activate-link",
-                                  G_CALLBACK(activate_link), windata);
-
-        atkobj = gtk_widget_get_accessible(windata->body_label);
-        atk_object_set_description(atkobj, "Notification body text.");
-
-        alignment = gtk_alignment_new(1, 0.5, 0, 0);
-        gtk_widget_show(alignment);
-        gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, TRUE, 0);
-
-        windata->actions_box = gtk_hbox_new(FALSE, 6);
-        gtk_container_add(GTK_CONTAINER(alignment), windata->actions_box);
-
-        return GTK_WINDOW(win);
+        gtk_box_pack_start (GTK_BOX (vbox), windata->body_label, TRUE, TRUE,
+                            0);
+        gtk_misc_set_alignment (GTK_MISC (windata->body_label), 0, 0);
+        gtk_label_set_line_wrap (GTK_LABEL (windata->body_label), TRUE);
+        g_signal_connect (G_OBJECT (windata->body_label),
+                          "activate-link",
+                          G_CALLBACK (activate_link),
+                          windata);
+
+        atkobj = gtk_widget_get_accessible (windata->body_label);
+        atk_object_set_description (atkobj, "Notification body text.");
+
+        alignment = gtk_alignment_new (1, 0.5, 0, 0);
+        gtk_widget_show (alignment);
+        gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0);
+
+        windata->actions_box = gtk_hbox_new (FALSE, 6);
+        gtk_container_add (GTK_CONTAINER (alignment), windata->actions_box);
+
+        return GTK_WINDOW (win);
 }
 
 void
-set_notification_hints(GtkWindow *nw, GHashTable *hints)
+set_notification_hints (GtkWindow  *nw,
+                        GHashTable *hints)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        GValue *value;
+        WindowData     *windata;
+        GValue         *value;
 
-        g_assert(windata != NULL);
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+        g_assert (windata != NULL);
 
-        value = (GValue *)g_hash_table_lookup(hints, "urgency");
+        value = (GValue *) g_hash_table_lookup (hints, "urgency");
 
-        if (value != NULL && G_VALUE_HOLDS_UCHAR(value))
-        {
-                windata->urgency = g_value_get_uchar(value);
+        if (value != NULL && G_VALUE_HOLDS_UCHAR (value)) {
+                windata->urgency = g_value_get_uchar (value);
 
                 if (windata->urgency == URGENCY_CRITICAL) {
-                        gtk_window_set_title(GTK_WINDOW(nw), "Critical Notification");
+                        gtk_window_set_title (GTK_WINDOW (nw),
+                                              "Critical Notification");
                 } else {
-                        gtk_window_set_title(GTK_WINDOW(nw), "Notification");
+                        gtk_window_set_title (GTK_WINDOW (nw),
+                                              "Notification");
                 }
         }
 }
 
 void
-set_notification_timeout(GtkWindow *nw, glong timeout)
+set_notification_timeout (GtkWindow *nw,
+                          glong      timeout)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        g_assert(windata != NULL);
+        WindowData *windata;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+        g_assert (windata != NULL);
 
         windata->timeout = timeout;
 }
 
 void
-notification_tick(GtkWindow *nw, glong remaining)
+notification_tick (GtkWindow *nw,
+                   glong      remaining)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+        WindowData *windata;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
         windata->remaining = remaining;
 
-        if (windata->pie_countdown != NULL)
-        {
-                gtk_widget_queue_draw_area(windata->pie_countdown, 0, 0,
-                                                                   PIE_WIDTH, PIE_HEIGHT);
+        if (windata->pie_countdown != NULL) {
+                gtk_widget_queue_draw_area (windata->pie_countdown,
+                                            0,
+                                            0,
+                                            PIE_WIDTH,
+                                            PIE_HEIGHT);
         }
 }
 
 void
-set_notification_text(GtkWindow *nw, const char *summary, const char *body)
+set_notification_text (GtkWindow  *nw,
+                       const char *summary,
+                       const char *body)
 {
-        char *str, *quoted;
-        GtkRequisition req;
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        g_assert(windata != NULL);
+        char           *str, *quoted;
+        GtkRequisition  req;
+        WindowData     *windata;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+        g_assert (windata != NULL);
 
-        quoted = g_markup_escape_text(summary, -1);
-        str = g_strdup_printf("<b><big>%s</big></b>", quoted);
-        g_free(quoted);
+        quoted = g_markup_escape_text (summary, -1);
+        str = g_strdup_printf ("<b><big>%s</big></b>", quoted);
+        g_free (quoted);
 
-        gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
-        g_free(str);
+        gtk_label_set_markup (GTK_LABEL (windata->summary_label), str);
+        g_free (str);
 
-        gtk_label_set_markup(GTK_LABEL(windata->body_label), body);
+        gtk_label_set_markup (GTK_LABEL (windata->body_label), body);
 
         if (body == NULL || *body == '\0')
-                gtk_widget_hide(windata->body_label);
+                gtk_widget_hide (windata->body_label);
         else
-                gtk_widget_show(windata->body_label);
+                gtk_widget_show (windata->body_label);
 
-        update_content_hbox_visibility(windata);
+        update_content_hbox_visibility (windata);
 
-        if (body != NULL && *body != '\0')
-        {
+        if (body != NULL && *body != '\0') {
                 gtk_widget_size_request (windata->iconbox, &req);
-                gtk_widget_set_size_request(
-                        windata->body_label,
-                        /* -1: border width for
-                           -6: spacing for hbox */
-                        WIDTH - (1*2) - (10*2) - req.width - 6,
-                        -1);
+                gtk_widget_set_size_request (windata->body_label,
+                                             /* -1: border width for
+                                                -6: spacing for hbox */
+                                             WIDTH - (1 * 2) - (10 * 2) - req.width - 6, -1);
         }
 
         gtk_widget_size_request (windata->close_button, &req);
-        gtk_widget_set_size_request(
-                windata->summary_label,
-                /* -1: main_vbox border width
-                   -10: vbox border width
-                   -6: spacing for hbox */
-                WIDTH - (1*2) - (10*2) - SPACER_LEFT - req.width - (6*2),
-                -1);
+        gtk_widget_set_size_request (windata->summary_label,
+                                     /* -1: main_vbox border width
+                                        -10: vbox border width
+                                        -6: spacing for hbox */
+                                     WIDTH - (1 * 2) - (10 * 2) - SPACER_LEFT - req.width - (6 * 2), -1);
 }
 
 void
-set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf)
+set_notification_icon (GtkWindow *nw,
+                       GdkPixbuf *pixbuf)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        g_assert(windata != NULL);
+        WindowData     *windata;
 
-        gtk_image_set_from_pixbuf(GTK_IMAGE(windata->icon), pixbuf);
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+        g_assert (windata != NULL);
 
-        if (pixbuf != NULL)
-        {
-                int pixbuf_width = gdk_pixbuf_get_width(pixbuf);
+        gtk_image_set_from_pixbuf (GTK_IMAGE (windata->icon), pixbuf);
 
-                gtk_widget_show(windata->icon);
-                gtk_widget_set_size_request(windata->iconbox,
-                                                                        MAX(BODY_X_OFFSET, pixbuf_width), -1);
-        }
-        else
-        {
-                gtk_widget_hide(windata->icon);
-                gtk_widget_set_size_request(windata->iconbox, BODY_X_OFFSET, -1);
+        if (pixbuf != NULL) {
+                int pixbuf_width = gdk_pixbuf_get_width (pixbuf);
+
+                gtk_widget_show (windata->icon);
+                gtk_widget_set_size_request (windata->iconbox,
+                                             MAX (BODY_X_OFFSET, pixbuf_width),
+                                             -1);
+        } else {
+                gtk_widget_hide (windata->icon);
+                gtk_widget_set_size_request (windata->iconbox,
+                                             BODY_X_OFFSET,
+                                             -1);
         }
 
-        update_content_hbox_visibility(windata);
+        update_content_hbox_visibility (windata);
 }
 
 void
-set_notification_arrow(GtkWidget *nw, gboolean visible, int x, int y)
+set_notification_arrow (GtkWidget *nw,
+                        gboolean   visible,
+                        int        x,
+                        int        y)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        g_assert(windata != NULL);
+        WindowData *windata;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+        g_assert (windata != NULL);
 
         windata->has_arrow = visible;
         windata->point_x = x;
         windata->point_y = y;
 
-        update_spacers(nw);
+        update_spacers (nw);
 }
 
 static gboolean
-countdown_expose_cb(GtkWidget *pie, GdkEventExpose *event,
-                                        WindowData *windata)
+countdown_expose_cb (GtkWidget      *pie,
+                     GdkEventExpose *event,
+                     WindowData     *windata)
 {
-        GtkStyle *style = gtk_widget_get_style(windata->win);
-        cairo_t *context;
+        GtkStyle        *style;
+        cairo_t         *context;
         cairo_surface_t *surface;
-        cairo_t *cr;
-
-        context = gdk_cairo_create(GDK_DRAWABLE(windata->pie_countdown->window));
-        cairo_set_operator(context, CAIRO_OPERATOR_SOURCE);
-        surface = cairo_surface_create_similar(
-                        cairo_get_target(context),
-                        CAIRO_CONTENT_COLOR_ALPHA,
-                        pie->allocation.width,
-                        pie->allocation.height);
-        cr = cairo_create(surface);
-
-        fill_background(pie, windata, cr);
-
-        if (windata->timeout > 0)
-        {
-                gdouble pct = (gdouble)windata->remaining / (gdouble)windata->timeout;
-
-                gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_ACTIVE]);
-
-                cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS);
-                cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS,
-                                                   -G_PI_2, -(pct * G_PI * 2) - G_PI_2);
-                cairo_line_to(cr, PIE_RADIUS, PIE_RADIUS);
-                cairo_fill(cr);
+        cairo_t         *cr;
+
+        style = gtk_widget_get_style (windata->win);
+        context = gdk_cairo_create (GDK_DRAWABLE
+                                    (windata->pie_countdown->window));
+        cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
+        surface = cairo_surface_create_similar (cairo_get_target (context),
+                                                CAIRO_CONTENT_COLOR_ALPHA,
+                                                pie->allocation.width,
+                                                pie->allocation.height);
+        cr = cairo_create (surface);
+
+        fill_background (pie, windata, cr);
+
+        if (windata->timeout > 0) {
+                gdouble pct = (gdouble) windata->remaining / (gdouble) windata->timeout;
+
+                gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_ACTIVE]);
+
+                cairo_move_to (cr, PIE_RADIUS, PIE_RADIUS);
+                cairo_arc_negative (cr,
+                                    PIE_RADIUS,
+                                    PIE_RADIUS,
+                                    PIE_RADIUS,
+                                    -G_PI_2,
+                                    -(pct * G_PI * 2) - G_PI_2);
+                cairo_line_to (cr, PIE_RADIUS, PIE_RADIUS);
+                cairo_fill (cr);
         }
 
-        cairo_destroy(cr);
-        cairo_set_source_surface(context, surface, 0, 0);
-        cairo_paint(context);
-        cairo_surface_destroy(surface);
-        cairo_destroy(context);
+        cairo_destroy (cr);
+        cairo_set_source_surface (context, surface, 0, 0);
+        cairo_paint (context);
+        cairo_surface_destroy (surface);
+        cairo_destroy (context);
 
         return TRUE;
 }
 
 static void
-action_clicked_cb(GtkWidget *w, GdkEventButton *event,
-                                  ActionInvokedCb action_cb)
+action_clicked_cb (GtkWidget      *w,
+                   GdkEventButton *event,
+                   ActionInvokedCb action_cb)
 {
-        GtkWindow *nw   = g_object_get_data(G_OBJECT(w), "_nw");
-        const char *key = g_object_get_data(G_OBJECT(w), "_action_key");
-
-        action_cb(nw, key);
+        GtkWindow  *nw;
+        const char *key;
+        nw = g_object_get_data (G_OBJECT (w), "_nw");
+        key = g_object_get_data (G_OBJECT (w), "_action_key");
+        action_cb (nw, key);
 }
 
 void
-add_notification_action(GtkWindow *nw, const char *text, const char *key,
-                                                ActionInvokedCb cb)
+add_notification_action (GtkWindow      *nw,
+                         const char     *text,
+                         const char     *key,
+                         ActionInvokedCb cb)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        GtkWidget *label;
-        GtkWidget *button;
-        GtkWidget *hbox;
-        GdkPixbuf *pixbuf;
-        char *buf;
-
-        g_assert(windata != NULL);
-
-        if (!GTK_WIDGET_VISIBLE(windata->actions_box))
-        {
-                GtkWidget *alignment;
-
-                gtk_widget_show(windata->actions_box);
-                update_content_hbox_visibility(windata);
-
-                alignment = gtk_alignment_new(1, 0.5, 0, 0);
-                gtk_widget_show(alignment);
-                gtk_box_pack_end(GTK_BOX(windata->actions_box), alignment,
-                                                   FALSE, TRUE, 0);
-
-                windata->pie_countdown = gtk_drawing_area_new();
-                gtk_widget_show(windata->pie_countdown);
-                gtk_container_add(GTK_CONTAINER(alignment), windata->pie_countdown);
-                gtk_widget_set_size_request(windata->pie_countdown,
-                                                                        PIE_WIDTH, PIE_HEIGHT);
-                g_signal_connect(G_OBJECT(windata->pie_countdown), "expose_event",
-                                                 G_CALLBACK(countdown_expose_cb), windata);
+        WindowData     *windata;
+        GtkWidget      *label;
+        GtkWidget      *button;
+        GtkWidget      *hbox;
+        GdkPixbuf      *pixbuf;
+        char           *buf;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+
+        g_assert (windata != NULL);
+
+        if (!GTK_WIDGET_VISIBLE (windata->actions_box)) {
+                GtkWidget      *alignment;
+
+                gtk_widget_show (windata->actions_box);
+                update_content_hbox_visibility (windata);
+
+                alignment = gtk_alignment_new (1, 0.5, 0, 0);
+                gtk_widget_show (alignment);
+                gtk_box_pack_end (GTK_BOX (windata->actions_box),
+                                  alignment,
+                                  FALSE,
+                                  TRUE,
+                                  0);
+
+                windata->pie_countdown = gtk_drawing_area_new ();
+                gtk_widget_show (windata->pie_countdown);
+                gtk_container_add (GTK_CONTAINER (alignment),
+                                   windata->pie_countdown);
+                gtk_widget_set_size_request (windata->pie_countdown,
+                                             PIE_WIDTH,
+                                             PIE_HEIGHT);
+                g_signal_connect (G_OBJECT (windata->pie_countdown),
+                                  "expose_event",
+                                  G_CALLBACK (countdown_expose_cb),
+                                  windata);
         }
 
-        button = gtk_button_new();
-        gtk_widget_show(button);
-        gtk_box_pack_start(GTK_BOX(windata->actions_box), button, FALSE, FALSE, 0);
+        button = gtk_button_new ();
+        gtk_widget_show (button);
+        gtk_box_pack_start (GTK_BOX (windata->actions_box),
+                            button,
+                            FALSE,
+                            FALSE,
+                            0);
 
-        hbox = gtk_hbox_new(FALSE, 6);
-        gtk_widget_show(hbox);
-        gtk_container_add(GTK_CONTAINER(button), hbox);
+        hbox = gtk_hbox_new (FALSE, 6);
+        gtk_widget_show (hbox);
+        gtk_container_add (GTK_CONTAINER (button), hbox);
 
         /* Try to be smart and find a suitable icon. */
-        buf = g_strdup_printf("stock_%s", key);
-        pixbuf = gtk_icon_theme_load_icon(
-                gtk_icon_theme_get_for_screen(
-                        gdk_drawable_get_screen(GTK_WIDGET(nw)->window)),
-                buf, 16, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
-        g_free(buf);
-
-        if (pixbuf != NULL)
-        {
-                GtkWidget *image = gtk_image_new_from_pixbuf(pixbuf);
-                gtk_widget_show(image);
-                gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
-                gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5);
+        buf = g_strdup_printf ("stock_%s", key);
+        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_for_screen
+                                           (gdk_drawable_get_screen (GTK_WIDGET (nw)->window)), buf,
+                                           16,
+                                           GTK_ICON_LOOKUP_USE_BUILTIN,
+                                           NULL);
+        g_free (buf);
+
+        if (pixbuf != NULL) {
+                GtkWidget *image;
+                image = gtk_image_new_from_pixbuf (pixbuf);
+                gtk_widget_show (image);
+                gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+                gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5);
         }
 
-        label = gtk_label_new(NULL);
-        gtk_widget_show(label);
-        gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-        buf = g_strdup_printf("<small>%s</small>", text);
-        gtk_label_set_markup(GTK_LABEL(label), buf);
-        g_free(buf);
-
-        g_object_set_data(G_OBJECT(button), "_nw", nw);
-        g_object_set_data_full(G_OBJECT(button),
-                                                   "_action_key", g_strdup(key), g_free);
-        g_signal_connect(G_OBJECT(button), "button-release-event",
-                                         G_CALLBACK(action_clicked_cb), cb);
+        label = gtk_label_new (NULL);
+        gtk_widget_show (label);
+        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+        gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+        buf = g_strdup_printf ("<small>%s</small>", text);
+        gtk_label_set_markup (GTK_LABEL (label), buf);
+        g_free (buf);
+
+        g_object_set_data (G_OBJECT (button), "_nw", nw);
+        g_object_set_data_full (G_OBJECT (button),
+                                "_action_key",
+                                g_strdup (key),
+                                g_free);
+        g_signal_connect (G_OBJECT (button),
+                          "button-release-event",
+                          G_CALLBACK (action_clicked_cb),
+                          cb);
 }
 
 void
-clear_notification_actions(GtkWindow *nw)
+clear_notification_actions (GtkWindow *nw)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
+        WindowData *windata;
+
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
 
         windata->pie_countdown = NULL;
 
-        gtk_widget_hide(windata->actions_box);
-        gtk_container_foreach(GTK_CONTAINER(windata->actions_box),
-                                                  (GtkCallback)gtk_object_destroy, NULL);
+        gtk_widget_hide (windata->actions_box);
+        gtk_container_foreach (GTK_CONTAINER (windata->actions_box),
+                               (GtkCallback) gtk_object_destroy,
+                               NULL);
 }
 
 void
-move_notification(GtkWidget *nw, int x, int y)
+move_notification (GtkWidget *nw,
+                   int        x,
+                   int        y)
 {
-        WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
-        g_assert(windata != NULL);
+        WindowData *windata;
 
-        if (windata->has_arrow)
-        {
-                gtk_widget_queue_resize(nw);
-        }
-        else
-        {
-                gtk_window_move(GTK_WINDOW(nw), x, y);
+        windata = g_object_get_data (G_OBJECT (nw), "windata");
+        g_assert (windata != NULL);
+
+        if (windata->has_arrow) {
+                gtk_widget_queue_resize (nw);
+        } else {
+                gtk_window_move (GTK_WINDOW (nw), x, y);
         }
 }
 
 void
-get_theme_info(char **theme_name,
-                           char **theme_ver,
-                           char **author,
-                           char **homepage)
+get_theme_info (char **theme_name,
+                char **theme_ver,
+                char **author,
+                char **homepage)
 {
-        *theme_name = g_strdup("Standard");
-        *theme_ver  = g_strdup_printf("%d.%d.%d",
-                                                                  NOTIFICATION_DAEMON_MAJOR_VERSION,
-                                                                  NOTIFICATION_DAEMON_MINOR_VERSION,
-                                                                  NOTIFICATION_DAEMON_MICRO_VERSION);
-        *author = g_strdup("Christian Hammond");
-        *homepage = g_strdup("http://www.galago-project.org/";);
+        *theme_name = g_strdup ("Standard");
+        *theme_ver = g_strdup_printf ("%d.%d.%d",
+                                      NOTIFICATION_DAEMON_MAJOR_VERSION,
+                                      NOTIFICATION_DAEMON_MINOR_VERSION,
+                                      NOTIFICATION_DAEMON_MICRO_VERSION);
+        *author = g_strdup ("Christian Hammond");
+        *homepage = g_strdup ("http://www.galago-project.org/";);
 }
 
 gboolean
-theme_check_init(unsigned int major_ver, unsigned int minor_ver,
-                                 unsigned int micro_ver)
+theme_check_init (unsigned int major_ver,
+                  unsigned int minor_ver,
+                  unsigned int micro_ver)
 {
-        return major_ver == NOTIFICATION_DAEMON_MAJOR_VERSION &&
-               minor_ver == NOTIFICATION_DAEMON_MINOR_VERSION &&
-               micro_ver == NOTIFICATION_DAEMON_MICRO_VERSION;
+        return major_ver == NOTIFICATION_DAEMON_MAJOR_VERSION
+                && minor_ver == NOTIFICATION_DAEMON_MINOR_VERSION
+                && micro_ver == NOTIFICATION_DAEMON_MICRO_VERSION;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]