[gnome-settings-daemon/gnome-3-30] power: Close the correct notification for device type



commit ef3e184d7c03380b6dda20043757ca0be4ee9f59
Author: Benjamin Berg <bberg redhat com>
Date:   Wed Sep 19 13:58:01 2018 +0200

    power: Close the correct notification for device type
    
    This improves the logic for closing notifications a bit either closing
    the UPS notification or the device notification. This is not a big
    improvement through, ideally we would keep track of the notifications on
    a per-device basis instead.

 plugins/power/gsd-power-manager.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index cad55637..c4f27592 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -819,8 +819,10 @@ engine_device_warning_changed_cb (UpDevice *device, GParamSpec *pspec, GsdPowerM
                  * for the whole system, instead of one per device */
                 g_debug ("fully charged or charging, hiding notifications if any");
                 play_loop_stop (&manager->priv->critical_alert_timeout_id);
-                notify_close_if_showing (&manager->priv->notification_low);
-                notify_close_if_showing (&manager->priv->notification_ups_discharging);
+                if (kind != UP_DEVICE_KIND_UPS)
+                        notify_close_if_showing (&manager->priv->notification_low);
+                else
+                        notify_close_if_showing (&manager->priv->notification_ups_discharging);
         }
 
         if (kind == UP_DEVICE_KIND_BATTERY ||


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