diff options
author | Tim Klocke <taaem@mailbox.org> | 2019-10-09 08:24:54 +0000 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2019-10-10 09:23:44 +0000 |
commit | ad4dbefbc05629a8f6756dcac75cbb9eb7ba5db8 (patch) | |
tree | 49397a0f9dfdac3ad4a43654d76ae71f9a1d4cf0 | |
parent | 5a486f5b6bf5f838db5dc2bfc5819a0cba5d2d19 (diff) | |
download | mutter-ad4dbefbc05629a8f6756dcac75cbb9eb7ba5db8.tar.gz |
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)
-rw-r--r-- | src/backends/meta-idle-monitor.c | 15 |
1 files 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); + } } } |