Merge pull request #442 from tsipinakis/dunstify-printid

Dunstify: Print id before blocking
This commit is contained in:
Nikos Tsipinakis 2017-11-22 18:23:43 +02:00 committed by GitHub
commit 9382cbbd15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);