summaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-03-21 12:06:06 -0400
committerLuke from DC <[email protected]>2026-04-02 19:19:35 +0000
commita7ba9a1701eddd9c9e55a4a88b0ea136440cc539 (patch)
tree1a04194521f05817a857be89d20d7bd4ac3bd044 /src/daemon
parent3e9622c956004afc33df2768dc0db66327fe534d (diff)
downloadmate-notification-daemon-master.tar.bz2
mate-notification-daemon-master.tar.xz
daemon: Fix NotificationClosed signal reason for close buttonHEADmaster
When clicking the close button on a notification, the D-Bus signal incorrectly sent reason=1 (expired) instead of reason=2 (dismissed). Fixed by setting a flag on the notification window in the close button callback before destroying it, and checking this flag in the callback to send the correct close reason. Fixes #129
Diffstat (limited to 'src/daemon')
-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 3c75add..473a598 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -758,8 +758,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