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
This commit is contained in:
Tim Klocke 2019-10-09 10:24:54 +02:00 committed by Jonas Ådahl
parent 658c741420
commit 81ee8886ce

View File

@ -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);
@ -514,6 +516,12 @@ meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor)
{
meta_idle_monitor_watch_fire (watch);
}
else
{
if (monitor->inhibited)
{
g_source_set_ready_time (watch->timeout_source, -1);
}
else
{
g_source_set_ready_time (watch->timeout_source,
@ -521,6 +529,7 @@ meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor)
watch->timeout_msec * 1000);
}
}
}
g_list_free (watch_ids);
}