Skip to content

Fix idle monitor race

Jonas Ådahl requested to merge jadahl/mutter:wip/fix-idle-monitor-race into master

This fixes an issue where the screen wouldn't be unblanked after switching back to the session. The cause was gnome-settings-daemon's power management plugin getting an idle signal that was incorrectly fired after the idle timeouts was reset, due to the idle source already being in the to-be-dispatched list in glib.

    idle-monitor: Postpone dispatching of idle timeout if not ready
    
    If we update the ready time while the source is already in the
    to-dispatch list, changing the ready time doesn't have any effect, and
    the source will still be dispatched. This could cause incorrect idle
    watch firing causing the power management plugin in
    gnome-settings-daemon to sometimes turn off monitors due to it believing
    the user had been idle for some time, while in fact, they just logged
    back in.
    
    Fix this by not actually dispatching the idle timeout if the ready time
    is in the future when actually dispatching.

Merge request reports