diff --git a/src/dbus.c b/src/dbus.c index 79af31c..24cc300 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -282,7 +282,7 @@ static void on_close_notification(GDBusConnection *connection, { guint32 id; g_variant_get(parameters, "(u)", &id); - notification_close_by_id(id, 3); + queues_notification_close_id(id, 3); wake_up(); g_dbus_method_invocation_return_value(invocation, NULL); g_dbus_connection_flush(connection, NULL, NULL, NULL); diff --git a/src/notification.c b/src/notification.c index a737696..d0269c4 100644 --- a/src/notification.c +++ b/src/notification.c @@ -451,7 +451,7 @@ void notification_init(notification *n) /* TODO: this should not be part of notification_init */ if (strlen(n->msg) == 0) { - notification_close(n, 2); + queues_notification_close(n, 2); if (settings.always_run_script) { notification_run_script(n); } diff --git a/src/queues.c b/src/queues.c index 737fb6e..1a0f606 100644 --- a/src/queues.c +++ b/src/queues.c @@ -50,7 +50,7 @@ int queues_notification_insert(notification *n, int replaces_id) } else { n->id = replaces_id; - if (!notification_replace_by_id(n)) + if (!queues_notification_replace_id(n)) g_queue_insert_sorted(queue, n, notification_cmp_data, NULL); } @@ -110,7 +110,7 @@ static int queues_stack_duplicate(notification *n) return -1; } -bool notification_replace_by_id(notification *new) +bool queues_notification_replace_id(notification *new) { for (GList *iter = g_queue_peek_head_link(displayed); @@ -141,7 +141,7 @@ bool notification_replace_by_id(notification *new) return false; } -int notification_close_by_id(int id, int reason) +int queues_notification_close_id(int id, int reason) { notification *target = NULL; @@ -174,20 +174,20 @@ int notification_close_by_id(int id, int reason) return reason; } -int notification_close(notification *n, int reason) +int queues_notification_close(notification *n, int reason) { assert(n != NULL); - return notification_close_by_id(n->id, reason); + return queues_notification_close_id(n->id, reason); } void move_all_to_history() { while (displayed->length > 0) { - notification_close(g_queue_peek_head_link(displayed)->data, 2); + queues_notification_close(g_queue_peek_head_link(displayed)->data, 2); } while (queue->length > 0) { - notification_close(g_queue_peek_head_link(queue)->data, 2); + queues_notification_close(g_queue_peek_head_link(queue)->data, 2); } } @@ -244,7 +244,7 @@ void queues_check_timeouts(bool idle) /* remove old message */ if (g_get_monotonic_time() - n->start > n->timeout) { - notification_close(n, 1); + queues_notification_close(n, 1); } } } diff --git a/src/queues.h b/src/queues.h index 0e8f1ad..14e9eb6 100644 --- a/src/queues.h +++ b/src/queues.h @@ -40,7 +40,7 @@ int queues_notification_insert(notification *n, int replaces_id); * Returns true, if a matching notification has been found * and is replaced. Else false. */ -bool notification_replace_by_id(notification *new); +bool queues_notification_replace_id(notification *new); /* * Close the notification that has id. @@ -53,10 +53,10 @@ bool notification_replace_by_id(notification *new); * 2 -> the notification was dismissed by the user_data * 3 -> The notification was closed by a call to CloseNotification */ -int notification_close_by_id(int id, int reason); +int queues_notification_close_id(int id, int reason); -/* Close the given notification. SEE notification_close_by_id. */ -int notification_close(notification *n, int reason); +/* Close the given notification. SEE queues_notification_close_id. */ +int queues_notification_close(notification *n, int reason); void history_pop(void); void history_push(notification *n); diff --git a/src/x11/x.c b/src/x11/x.c index 156bfca..686334a 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -857,7 +857,7 @@ gboolean x_mainloop_fd_dispatch(GSource *source, GSourceFunc callback, if (displayed) { notification *n = g_queue_peek_head(displayed); if (n) { - notification_close(n, 2); + queues_notification_close(n, 2); wake_up(); } } @@ -939,7 +939,7 @@ static void x_handle_click(XEvent ev) if (n) { if (ev.xbutton.button == Button1) - notification_close(n, 2); + queues_notification_close(n, 2); else notification_do_action(n); }