MetaIdleMonitorNative: initialize last event timestamp

If this isn't initialized and an idle watch gets instanced before
meta_idle_monitor_native_reset_idletime() gets called, that idle watch
would get triggered as soon as we hit the main loop.

This was causing gnome-session to go into idle mode at session start
thus making gnome-shell lock the screen.

In the past this bug was being masked by either logind emiting
session active signals or a stray input event making it through at
startup.

https://bugzilla.gnome.org/show_bug.cgi?id=772839
This commit is contained in:
Rui Matos 2016-10-13 21:48:58 +02:00
parent fc8de3d0c8
commit 280e297afe

View File

@ -162,6 +162,7 @@ meta_idle_monitor_native_init (MetaIdleMonitorNative *monitor_native)
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_native);
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
monitor_native->last_event_time = g_get_monotonic_time ();
}
void