summaryrefslogtreecommitdiff
path: root/src/daemon/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r--src/daemon/daemon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index e5033de..a7c63a6 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -756,8 +756,14 @@ static void _notification_destroyed_cb(GtkWindow* nw, NotifyDaemon* daemon)
/*
* This usually won't happen, but can if notification-daemon dies before
* all notifications are closed. Mark them as expired.
+ *
+ * But if instead the notification's close button was clicked, the
+ * "_user_closed" flag will be set on the window, so we send the
+ * correct reason.
*/
- _close_notification(daemon, NW_GET_NOTIFY_ID(nw), FALSE, NOTIFYD_CLOSED_EXPIRED);
+ gboolean user_closed = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(nw), "_user_closed"));
+ _close_notification(daemon, NW_GET_NOTIFY_ID(nw), FALSE,
+ user_closed ? NOTIFYD_CLOSED_USER : NOTIFYD_CLOSED_EXPIRED);
}
#ifdef HAVE_X11