[gnome-settings-daemon/benzea/fix-upower-device-add] power: Close the correct notification for device type
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/benzea/fix-upower-device-add] power: Close the correct notification for device type
- Date: Wed, 19 Sep 2018 12:21:54 +0000 (UTC)
commit 0a7181d34b5345e58e33f7fd839fef3852fc74ac
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..1da8e2b5 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]