From 51a98b8fd09a74acee7d0d9f532d1762676a032a Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Wed, 22 Nov 2017 17:49:50 +0200 Subject: [PATCH] Dunstify: Print id before blocking Print the notification id, if requested, before blocking to catch action return or NotificationClosed signal since once of those events happens the program will exit without further action, bypassing the id printing logic. --- dunstify.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dunstify.c b/dunstify.c index 009e299..b4237cb 100644 --- a/dunstify.c +++ b/dunstify.c @@ -296,9 +296,10 @@ int main(int argc, char *argv[]) GMainLoop *l = NULL; - if (block || action_strs) + if (block || action_strs) { l = g_main_loop_new(NULL, false); g_signal_connect(n, "closed", G_CALLBACK(closed), NULL); + } if (action_strs) for (int i = 0; action_strs[i]; i++) { @@ -317,13 +318,12 @@ int main(int argc, char *argv[]) die(1); } + if (printid) + g_print("%d\n", get_id(n)); + if (block || action_strs) g_main_loop_run(l); - if (printid) { - g_print("%d\n", get_id(n)); - } - g_object_unref(G_OBJECT (n)); die(0);