Skip to content

Commit

Permalink
Fix the loop bug for good
Browse files Browse the repository at this point in the history
  • Loading branch information
bluesabre committed Feb 20, 2018
1 parent 16a735d commit 9d36dbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/greeterbackground.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,11 +741,14 @@ greeter_background_set_active_monitor(GreeterBackground* background,
* timestamp at this precision (1/10th of a second), this should no longer be
* possible.
*/
if (!active)
if (active != NULL)
{
timestamp = floor(g_get_monotonic_time () * 0.00001);
if (timestamp == priv->active_monitor_change_last_timestamp)
{
g_debug("[Background] Preventing infinite monitor loop");
return;
}
}

priv->active_monitor_change_in_progress = TRUE;
Expand Down

0 comments on commit 9d36dbd

Please sign in to comment.