Bug 25855 - Screensaver not disabled because of a XResetScreenSaver() regression
Summary: Screensaver not disabled because of a XResetScreenSaver() regression
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 7.4 (2008.09)
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2010-01-02 02:34 UTC by Lubos Lunak
Modified: 2010-02-12 15:02 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
xserver patch (500 bytes, patch)
2010-01-02 02:34 UTC, Lubos Lunak
no flags Details | Splinter Review
test app 1 (197 bytes, text/x-c++src)
2010-01-02 02:34 UTC, Lubos Lunak
no flags Details
test app 2 (665 bytes, text/x-c++src)
2010-01-02 02:34 UTC, Lubos Lunak
no flags Details

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.