[gnome-settings-daemon] power: Clamp the battery/mains timeouts



commit a228fd4dc298c02f7c8b359c36f71ba8243f51f5
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Sep 16 17:45:38 2016 +0200

    power: Clamp the battery/mains timeouts
    
    As the value can be < 0, make sure that we don't set up timeouts for
    negative amounts of time.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771543

 plugins/power/gsd-power-manager.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index b43356a..b8d0d63 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1716,6 +1716,7 @@ idle_configure (GsdPowerManager *manager)
         if (!is_action_inhibited (manager, action_type)) {
                 timeout_sleep = g_settings_get_int (manager->priv->settings, on_battery ?
                                                     "sleep-inactive-battery-timeout" : 
"sleep-inactive-ac-timeout");
+                timeout_sleep = CLAMP(timeout_sleep, 0, G_MAXINT);
         }
 
         clear_idle_watch (manager->priv->idle_monitor,


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