[gpm] [FIX] gnome screensaver blanks even when user is not idle



Hi Richard,

While reviewing gnome-session/gs-idle-monitor.c, I noticed a potential
race condition: watch->xalarm_negative and watch->xalarm_positive are
both initialized using the same wait value. This poses a problem
because positive transitions activate when new_value >= wait_value,
but negative_transitions only activate when wait_value < old_value, so
there is a period of time where the user could move the mouse but no
event would be fired.

To fix this, I suggest we subtract one from the wait value we use for
negative transitions. This ensures that wait_value < old_value. This
fix is already implemented in the KDE code base and will soon be
implemented in Chromium OS code base as well. I'm sending this email
to you so that we can make sure gnome-screensaver is fixed too.

Links:
  - The KDE version of this class (which has a comment explaining why
they need to subtract one):
http://websvn.kde.org/branches/KDE/4.4/kdelibs/kutils/kidletime/xsyncbasedpoller.cpp?revision=1070858&view=markup
  - My fix to Chromium OS (which includes a test case):
http://codereview.chromium.org/1035001

Cheers,

David


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]