Bug 25855

Summary: Screensaver not disabled because of a XResetScreenSaver() regression
Product: xorg Reporter: Lubos Lunak <l.lunak>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: eich, freedesktop-bugs, mat, sndirsch
Version: 7.4 (2008.09)Keywords: patch, regression
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xserver patch
none
test app 1
none
test app 2 none

Description Lubos Lunak 2010-01-02 02:34:15 UTC
Created attachment 32398 [details] [review]
xserver patch

After xserver commit a32d717ac64b21e15a5736ae4981cdd32f2da56b applications using XResetScreenSaver() no longer prevent the KDE screensaver from activating, which uses XScreenSaverQueryInfo() to detect the idle time and activates after a specified timeout. After this commit there appears to be no way to detect that XResetScreenSaver() has been used (the IDLE timer is presumably affected as well).

Testcase: The two attached test apps.
$ g++ -I/usr/include/X11R6 a.cpp -lX11 -o a.out 
$ g++ -I/usr/include/X11R6 b.cpp -lX11 -lXss -o b.out
$ ( sleep 20; ./a.out ) &
$ ./b.out
The time is not reset after 20 seconds even though it should.

Assuming a32d717ac64b21e15a5736ae4981cdd32f2da56b is correct, then I suggest the attached patch.
Comment 1 Lubos Lunak 2010-01-02 02:34:36 UTC
Created attachment 32399 [details]
test app 1
Comment 2 Lubos Lunak 2010-01-02 02:34:53 UTC
Created attachment 32400 [details]
test app 2
Comment 3 Julien Cristau 2010-02-12 15:02:13 UTC
Fixed in master, thanks for the report!

commit 001ce71dc11287dc94cc2fbc5d35677c046e6c04
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Feb 12 23:34:57 2010 +0100

    dix: restore lastDeviceEventTime update in dixSaveScreens
    
    This was removed in 6b5978dcf1f7ac3ecc2f22df06f7000f360e2066 (Do not
    reset lastDeviceEventTime when we do dixSaveScreens), but caused a
    regression for XResetScreenSaver.  Add the lastDeviceEventTime update
    back, but restrict it to that case.
    
    X.Org bug#25855 <http://bugs.freedesktop.org/25855>
    
    Reported-by: Lubos Lunak <l.lunak@suse.cz>
    Tested-by: Lubos Lunak <l.lunak@suse.cz>
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    Signed-off-by: Keith Packard <keithp@keithp.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.