[gnome-settings-daemon/benzea/fix-upower-device-add] power: Close the correct notification for device type



commit 8ce4537224dc00fcaba719766c98aff004b2281b
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..008e516a 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]