[mutter] backends: Update inhibited state for the monitor and respect that state
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends: Update inhibited state for the monitor and respect that state
- Date: Wed, 9 Oct 2019 10:02:37 +0000 (UTC)
commit 81ee8886ceb64fecff74655cb971966cb88295d7
Author: Tim Klocke <taaem mailbox org>
Date: Wed Oct 9 10:24:54 2019 +0200
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
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 9fa481742..2ff1602e7 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);
@@ -516,9 +518,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]