linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.55k stars 740 forks source link

Cinnamon - Critical Notification behaviour #9391

Open smurphos opened 4 years ago

smurphos commented 4 years ago

Hi,

If my understanding of https://github.com/linuxmint/cinnamon/blob/master/js/ui/messageTray.js is correct the intention is that a notification with urgency set to critical should, if the notification applet is present, display on screen for 10 seconds and then retire to the applet. If the applet is not present it should remain on screen until dismissed.

On Mint 20 - Critical notifications are not retiring to the applet - they remain on screen until dismissed blocking display of further notifications (including further critical notifications), irrespective of whether the applet is present or not.

Relevant settings -

 gsettings list-recursively org.cinnamon.desktop.notifications
org.cinnamon.desktop.notifications display-notifications true
org.cinnamon.desktop.notifications bottom-notifications false
org.cinnamon.desktop.notifications fade-on-mouseover true
org.cinnamon.desktop.notifications fade-opacity 40
org.cinnamon.desktop.notifications remove-old false
org.cinnamon.desktop.notifications timeout 1800
gsettings get org.cinnamon enabled-applets
['panel1:left:0:menu@cinnamon.org:0', 'panel1:left:1:show-desktop@cinnamon.org:1', 'panel1:left:2:grouped-window-list@cinnamon.org:2', 'panel1:right:0:systray@cinnamon.org:3', 'panel1:right:1:xapp-status@cinnamon.org:4', 'panel1:right:2:notifications@cinnamon.org:5', 'panel1:right:3:printers@cinnamon.org:6', 'panel1:right:4:removable-drives@cinnamon.org:7', 'panel1:right:5:keyboard@cinnamon.org:8', 'panel1:right:6:network@cinnamon.org:9', 'panel1:right:7:sound@cinnamon.org:10', 'panel1:right:8:power@cinnamon.org:11', 'panel1:right:9:calendar@cinnamon.org:12']

Test notifications

notify-send -u critical "Help" Result remains on screen until dismissed. A second notify-send -u critical "Don't just sit there staring - HELP!" doesn't display until the first notification is dismissed.

clefebvre commented 4 years ago

I think that's the correct/wanted behavior.

clefebvre commented 4 years ago

Moving to Cinnamon.

clefebvre commented 4 years ago

@itzexor what do you think, I remember you worked on this.

itzexor commented 4 years ago

Hi @clefebvre, I'm currently out of town for most of this week so I don't have access to my own computer to do testing, but I suspect this may only be an issue for transient notification sources. A good test might be to use the web notification generator in chrome/chromium to present a critical notification and see if that one disappears after 10s as expected. I do also recall conversation sometime back about whether allowing critical notifications to hide was correct or not - but I can't find any commits related to that behavior specifically so I can't say for sure.

One other thing is to ensure the mouse isn't over the notification because I believe that will keep it around until the mouse is moved away.

With a notification source like notify-send, the source is removed immediately and may be causing the notification expire timeout to be removed without actually running the source-disappeared-clear-notifications logic and leaving it hanging forever. Testing with a non-transient source could confirm this.

https://tests.peter.sh/notification-generator/ Either Req. Interaction or Persistent should set critical, but I can't easily test or confirm this at the moment. Most options on that page are only supported in Chrome/Chromium.

smurphos commented 4 years ago

Hi both,

Testing https://tests.peter.sh/notification-generator/ with Req. Interaction set results in a notification that stays on screen until dismissed.

dbus-monitor output

signal time=1592893166.003575 sender=org.freedesktop.DBus -> destination=:1.418 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.418"
method call time=1592893172.760244 sender=:1.411 -> destination=org.freedesktop.Notifications serial=15 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Google Chrome"
   uint32 0
   string "file:///tmp/.com.google.Chrome.G95NYB"
   string "Notification title"
   string "tests.peter.sh

Notification content"
   array [
      string "default"
      string "Activate"
      string "settings"
      string "Settings"
   ]
   array [
      dict entry(
         string "urgency"
         variant             uint32 2
      )
      dict entry(
         string "desktop-entry"
         variant             string "google-chrome"
      )
      dict entry(
         string "image_path"
         variant             string "/tmp/.com.google.Chrome.uvGANA"
      )
      dict entry(
         string "image-path"
         variant             string "/tmp/.com.google.Chrome.uvGANA"
      )
   ]
   int32 0