diff options
| author | Victor Kareh <[email protected]> | 2026-03-21 12:06:06 -0400 |
|---|---|---|
| committer | Victor Kareh <[email protected]> | 2026-03-22 17:34:10 -0400 |
| commit | 24562cc76211579c9169039dab5d337a4731cf6e (patch) | |
| tree | 3e5a85959b33093c71d2ba888515e63aea2b1343 /src/daemon | |
| parent | 3f72f66032c6f9b80fc22e15a2fb33804d000bc6 (diff) | |
| download | mate-notification-daemon-fix-close-reason.tar.bz2 mate-notification-daemon-fix-close-reason.tar.xz | |
daemon: Fix NotificationClosed signal reason for close buttonfix-close-reason
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.c | 8 |
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 |
