[gnome-settings-daemon] power: Always expand power notifications



commit e0edc15ab8cf5560191a5c0bec3027f7369f7155
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 24 18:50:49 2015 +0100

    power: Always expand power notifications
    
    Work-around weird notification semantics where power related
    notifications wouldn't be expanded in the lock screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758521

 plugins/power/gsd-power-manager.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index d3908f2..1091d89 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -315,6 +315,8 @@ create_notification (const char *summary,
         notification = notify_notification_new (summary, body, icon_name);
         /* TRANSLATORS: this is the notification application name */
         notify_notification_set_app_name (notification, _("Power"));
+        notify_notification_set_urgency (notification,
+                                         NOTIFY_URGENCY_CRITICAL);
         *weak_pointer_location = notification;
         g_object_add_weak_pointer (G_OBJECT (notification),
                                    (gpointer *) weak_pointer_location);
@@ -365,8 +367,6 @@ engine_ups_discharging (GsdPowerManager *manager, UpDevice *device)
                              &manager->priv->notification_ups_discharging);
         notify_notification_set_timeout (manager->priv->notification_ups_discharging,
                                          GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG);
-        notify_notification_set_urgency (manager->priv->notification_ups_discharging,
-                                         NOTIFY_URGENCY_NORMAL);
         notify_notification_set_hint (manager->priv->notification_ups_discharging,
                                       "transient", g_variant_new_boolean (TRUE));
 
@@ -512,8 +512,6 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
                              &manager->priv->notification_low);
         notify_notification_set_timeout (manager->priv->notification_low,
                                          GSD_POWER_MANAGER_NOTIFY_TIMEOUT_LONG);
-        notify_notification_set_urgency (manager->priv->notification_low,
-                                         NOTIFY_URGENCY_NORMAL);
         notify_notification_set_hint (manager->priv->notification_low,
                                       "transient", g_variant_new_boolean (TRUE));
 
@@ -662,8 +660,6 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
                              &manager->priv->notification_low);
         notify_notification_set_timeout (manager->priv->notification_low,
                                          NOTIFY_EXPIRES_NEVER);
-        notify_notification_set_urgency (manager->priv->notification_low,
-                                         NOTIFY_URGENCY_CRITICAL);
 
         notify_notification_show (manager->priv->notification_low, NULL);
 
@@ -769,8 +765,6 @@ engine_charge_action (GsdPowerManager *manager, UpDevice *device)
                              &manager->priv->notification_low);
         notify_notification_set_timeout (manager->priv->notification_low,
                                          NOTIFY_EXPIRES_NEVER);
-        notify_notification_set_urgency (manager->priv->notification_low,
-                                         NOTIFY_URGENCY_CRITICAL);
 
         /* try to show */
         notify_notification_show (manager->priv->notification_low, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]