[mutter/gnome-3-32] backends: Update inhibited state for the monitor and respect that state



commit ad4dbefbc05629a8f6756dcac75cbb9eb7ba5db8
Author: Tim Klocke <taaem mailbox org>
Date:   Wed Oct 9 08:24:54 2019 +0000

    backends: Update inhibited state for the monitor and respect that state
    
    The inhibited state of the monitor was after the initializiation never
    updated. meta_idle_monitor_reset_idletime didn't respect the inhibited
    state, so it set timeouts if it shouldn't have.
    
    Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/573
    
    
    (cherry picked from commit 81ee8886ceb64fecff74655cb971966cb88295d7)

 src/backends/meta-idle-monitor.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-idle-monitor.c b/src/backends/meta-idle-monitor.c
index e83d6c778..f4678deaf 100644
--- a/src/backends/meta-idle-monitor.c
+++ b/src/backends/meta-idle-monitor.c
@@ -207,6 +207,8 @@ update_inhibited (MetaIdleMonitor *monitor,
   if (inhibited == monitor->inhibited)
     return;
 
+  monitor->inhibited = inhibited;
+
   g_hash_table_foreach (monitor->watches,
                         update_inhibited_watch,
                         monitor);
@@ -515,9 +517,16 @@ meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor)
         }
       else
         {
-          g_source_set_ready_time (watch->timeout_source,
-                                   monitor->last_event_time +
-                                   watch->timeout_msec * 1000);
+          if (monitor->inhibited)
+            {
+              g_source_set_ready_time (watch->timeout_source, -1);
+            }
+          else
+            {
+              g_source_set_ready_time (watch->timeout_source,
+                                       monitor->last_event_time +
+                                       watch->timeout_msec * 1000);
+            }
         }
     }
 


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