Package: dunst
Version: 1.0.0-2
Severity: important
Tags: patch

Doing the following:

  $ notify-send 'test'; notify-send DUNST_COMMAND_PAUSE

will cause dunst to enter an infinite loop.
Possibly related to bug #729690.

In the attached patch, we see how it's obvious that we keep popping from the
wrong queue.

Also in the patch, a double call to run(NULL) can be avoided while processing a
new notification (which I discovered while tracking down this bug).

Thanks.
diff -rud dunst-1.0.0.Orig/dbus.c dunst-1.0.0/dbus.c
--- dunst-1.0.0.Orig/dbus.c	2014-03-05 12:41:03.274349758 +0100
+++ dunst-1.0.0/dbus.c	2014-03-05 15:12:11.750747537 +0100
@@ -278,13 +278,11 @@
         n->color_strings[ColBG] = bgcolor;
 
         int id = notification_init(n, replaces_id);
-        wake_up();
-
         GVariant *reply = g_variant_new("(u)", id);
         g_dbus_method_invocation_return_value(invocation, reply);
         g_dbus_connection_flush(connection, NULL, NULL, NULL);
 
-        run(NULL);
+        wake_up();
 }
 
 static void onCloseNotification(GDBusConnection * connection,
diff -rud dunst-1.0.0.Orig/dunst.c dunst-1.0.0/dunst.c
--- dunst-1.0.0.Orig/dunst.c	2014-03-05 12:41:03.274349758 +0100
+++ dunst-1.0.0/dunst.c	2014-03-05 15:12:00.806747057 +0100
@@ -105,7 +105,7 @@
 
         if (pause_display) {
                 while (displayed->length > 0) {
-                        g_queue_insert_sorted(queue, g_queue_pop_head(queue),
+                        g_queue_insert_sorted(queue, g_queue_pop_head(displayed),
                                               notification_cmp_data, NULL);
                 }
                 return;

Reply via email to