diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-16 13:48:25 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-16 13:48:25 +0200 |
commit | cb9b1aaad8e50b3117d28f29fed0a1569bfde681 (patch) | |
tree | c8823182168dfb8fe28a56d10b5e10b487c1dab8 /src/up-daemon.c | |
parent | bda51f5284419cf4b548e754bcadd01d22c75e68 (diff) | |
download | upower-cb9b1aaad8e50b3117d28f29fed0a1569bfde681.tar.gz |
daemon: Only modify display device when it changes
When none of the properties of the display device change,
do not modify it.
Diffstat (limited to 'src/up-daemon.c')
-rw-r--r-- | src/up-daemon.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c index c8da84c..57beb9d 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -292,6 +292,17 @@ up_daemon_update_display_battery (UpDaemon *daemon) } out: + /* Did anything change? */ + if (daemon->priv->kind == kind_total && + daemon->priv->state == state_total && + daemon->priv->energy == energy_total && + daemon->priv->energy_full == energy_full_total && + daemon->priv->energy_rate == energy_rate_total && + daemon->priv->time_to_empty == time_to_empty_total && + daemon->priv->time_to_full == time_to_full_total && + daemon->priv->percentage == percentage_total) + return FALSE; + daemon->priv->kind = kind_total; daemon->priv->state = state_total; daemon->priv->energy = energy_total; @@ -315,7 +326,6 @@ out: "power-supply", TRUE, NULL); - /* FIXME: Return whether the above actually changed significantly */ return TRUE; } |