Upon further testing, while my previous patch does fix a code path which results in the idle watch timer not being reset, it has not fully fixed this bug. There still appears to be a race condition in which the idle watch timer is sometimes not being reset. Try as I have, I have not been able to isolate the exact reason for it.
However, I have a work-around that seems to fix the problem fully. It is the fairly ugly solution of calling reset_idle_watch from within the on_idle_timeout callback. While it might not be elegant, it does guarantee that the idle timeout is always reset.
I have tested this patch on two machines for nearly the last 3 months, and not once has my session failed to go idle, and activate the screensaver, when it was supposed to. Furthermore, I have watched for any undesirable behavior from the screensaver or session (such as, screensaver deactivating without activity, session going idle when active, high processor usage, etc.) and have seen no undesirable activity.
The following patch does *not* supercede my previous patch. For the full fix, both patches are required. The following patch is made against Ubuntu gnome-session 2.30.0-0ubuntu1.
Upon further testing, while my previous patch does fix a code path which results in the idle watch timer not being reset, it has not fully fixed this bug. There still appears to be a race condition in which the idle watch timer is sometimes not being reset. Try as I have, I have not been able to isolate the exact reason for it.
However, I have a work-around that seems to fix the problem fully. It is the fairly ugly solution of calling reset_idle_watch from within the on_idle_timeout callback. While it might not be elegant, it does guarantee that the idle timeout is always reset.
I have tested this patch on two machines for nearly the last 3 months, and not once has my session failed to go idle, and activate the screensaver, when it was supposed to. Furthermore, I have watched for any undesirable behavior from the screensaver or session (such as, screensaver deactivating without activity, session going idle when active, high processor usage, etc.) and have seen no undesirable activity.
The following patch does *not* supercede my previous patch. For the full fix, both patches are required. The following patch is made against Ubuntu gnome-session 2.30.0-0ubuntu1.