mate-desktop / mate-notification-daemon

Daemon to display passive pop-up notifications
https://mate-desktop.org
GNU General Public License v2.0
30 stars 26 forks source link

"reason" value in NotificationClosed signal seems to not follow freedesktop spec #129

Open tofurky opened 6 years ago

tofurky commented 6 years ago

Expected behaviour

When manually closing a notification by clicking the "x" in the upper right of the notification bubble, the NotificationClosed signal for that notification should show the reason as being dismissed by user (reason=2).

Per the spec for the NotificationClosed signal:

Table 8. NotificationClosed Parameters

Name    Type    Description
id  UINT32  The ID of the notification that was closed.
reason  UINT32  
The reason the notification was closed.

Name | Type | Description
-- | -- | --
id | UINT32 | The ID of the notification that was closed.
reason | UINT32 | The reason the notification was closed.
   1 - The notification expired.
   2 - The notification was dismissed by the user.
   3 - The notification was closed by a call to CloseNotification.
   4 - Undefined/reserved reasons.

Actual behaviour

The NotificationClosed signal sends reason=1 "The notification expired" when clicking the "x" in the upper-right of the notification bubble. Clicking the body of the notification does send reason=2 as would be expected. An expired notification also sends reason=1 as expected. The "coco" theme doesn't appear to be affected by this, as there is no "x" to click in that case.

Example "dbus-monitor" capture when clicking "x" to dismiss:

method call time=1524218596.200121 sender=:1.1389 -> destination=:1.1391 serial=7 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "notify-send"
   uint32 0
   string ""
   string "bugreport"
   string ""
   array [
   ]
   array [
      dict entry(
         string "urgency"
         variant             byte 1
      )
   ]
   int32 5000
signal time=1524218598.413795 sender=:1.1391 -> destination=:1.1389 serial=14 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=NotificationClosed
   uint32 1
   uint32 1

Steps to reproduce the behaviour

As the user running mate-notification-daemon, open a terminal and execute the following to monitor the session bus: dbus-monitor --session interface='org.freedesktop.Notifications'

In another terminal execute the following to send a notification using the "notify-send" utility (from libnotify-bin in Debian/Ubuntu): notify-send -t 5000 bugreport

Click the "x" to manually close the notification within 5s.

If you inspect the output of dbus-monitor, you will see that the reason is given as "1", incorrectly signifying that the notification expired.

MATE general version

1.18.0

Package version

1.18.0-2ubuntu1

Linux Distribution

Ubuntu 17.10 amd64

Link to downstream report of your Distribution

N/A

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/57355597-reason-value-in-notificationclosed-signal-seems-to-not-follow-freedesktop-spec?utm_campaign=plugin&utm_content=tracker%2F1172660&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1172660&utm_medium=issues&utm_source=github).