Do not delete notifications if they could not be displayed.
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Thu, 5 Jun 2014 11:46:32 +0000 (13:46 +0200)
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Thu, 5 Jun 2014 11:46:32 +0000 (13:46 +0200)
Change-Id: I1be3c02f848cc9c706dbbcc9a1f83998ec172059
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
notification_display_service.c

index a1b56f1..4550f44 100644 (file)
@@ -46,8 +46,15 @@ void display_notifications ()
                        wlmessage_set_icon (wlmessage, image_path);
                        wlmessage_set_message (wlmessage, content);
                        wlmessage_add_button (wlmessage, 0, "Ok");
-                       wlmessage_show (wlmessage, NULL);
+                       if (wlmessage_show (wlmessage, NULL) < 0) {
+                               wlmessage_destroy (wlmessage);
+                               return;
+                       }
                        wlmessage_destroy (wlmessage);
+#                      else
+                       fprintf(stderr, "\nNew Notification : %s\n", title); 
+                       fprintf(stderr, "Icon : %s\n", image_path); 
+                       fprintf(stderr, "Message : %s\n", content); 
 #                      endif
 
                        get_list = notification_list_remove(get_list, noti);