Bug#664248: notification-daemon: notification timeout not respected (0.7.6)

Jason Benjamin hexusnexus at gmail.com
Fri Nov 2 14:30:17 UTC 2012


Here, see what you can do with it, but here's a patch that works on the 
current 0.7.6 version of notification-daemon in the Gnome repositories.  
Someone's gotta do something about these software centralization issues, 
I saw an alternative version of the patch somewhere around here...
-------------- next part --------------
Only in notification-daemon-0.7.6-patched: daemon.c
diff -crB notification-daemon-0.7.6/src/nd-bubble.c notification-daemon-0.7.6-patched/src/nd-bubble.c
*** notification-daemon-0.7.6/src/nd-bubble.c	2011-08-16 09:58:18.000000000 -0700
--- notification-daemon-0.7.6-patched/src/nd-bubble.c	2012-10-21 01:21:29.210166403 -0700
***************
*** 395,406 ****
  static void
  add_timeout (NdBubble *bubble)
  {
          if (bubble->priv->timeout_id != 0) {
                  g_source_remove (bubble->priv->timeout_id);
          }
!         bubble->priv->timeout_id = g_timeout_add_seconds (TIMEOUT_SEC,
                                                            (GSourceFunc)timeout_bubble,
                                                            bubble);
  }
  
  static void
--- 395,418 ----
  static void
  add_timeout (NdBubble *bubble)
  {
+         int timeout = nd_notification_get_timeout(bubble->priv->notification);
+         
          if (bubble->priv->timeout_id != 0) {
                  g_source_remove (bubble->priv->timeout_id);
          }
!         if (timeout > 0) {
!                 bubble->priv->timeout_id = g_timeout_add (timeout,
                                                            (GSourceFunc)timeout_bubble,
                                                            bubble);
+         }
+         else if (timeout == -1) {
+                 bubble->priv->timeout_id = g_timeout_add_seconds (TIMEOUT_SEC,
+                                                           (GSourceFunc)timeout_bubble,
+                                                           bubble);
+         }
+         else {
+                 bubble->priv->timeout_id = 0;
+         }        
  }
  
  static void
diff -crB notification-daemon-0.7.6/src/nd-notification.c notification-daemon-0.7.6-patched/src/nd-notification.c
*** notification-daemon-0.7.6/src/nd-notification.c	2011-08-16 09:58:18.000000000 -0700
--- notification-daemon-0.7.6-patched/src/nd-notification.c	2012-10-21 01:17:06.138473662 -0700
***************
*** 290,295 ****
--- 290,303 ----
          return notification->hints;
  }
  
+ int
+ nd_notification_get_timeout (NdNotification *notification)
+ {
+         g_return_val_if_fail (ND_IS_NOTIFICATION (notification), -1);
+ 
+         return notification->timeout;
+ }
+ 
  char **
  nd_notification_get_actions (NdNotification *notification)
  {


More information about the pkg-gnome-maintainers mailing list