[gnome-settings-daemon] power: Don't dim when idle is inhibited



commit a9a882c67ac1b81da272d72d0036547dacedccdb
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 11 21:28:24 2013 -0500

    power: Don't dim when idle is inhibited
    
    We expect movie players and similar to inhibit idle as a way to
    prevent the screensaver from kicking in. We may even get firefox
    to do this for HTML5 video. But constant screen dimming is just as
    disruptive to the movie experience, so I think we should not do it
    when idle is inhibited.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691002

 plugins/power/gsd-power-manager.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index ee22385..76f31d4 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2931,6 +2931,9 @@ kbd_backlight_dim (GsdPowerManager *manager,
         return TRUE;
 }
 
+static gboolean
+idle_is_session_inhibited (GsdPowerManager *manager, guint mask);
+
 static void
 idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode)
 {
@@ -2989,6 +2992,12 @@ idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode)
                         return;
                 }
 
+                ret = idle_is_session_inhibited (manager, SESSION_INHIBIT_MASK_IDLE);
+                if (ret) {
+                        g_debug ("not dimming because idle is inhibited");
+                        return;
+                }
+
                 /* display backlight */
                 idle_percentage = g_settings_get_int (manager->priv->settings,
                                                       "idle-brightness");



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