Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211323 - media-libs/libsdl tampers with screensaver (session locking and power management) settings on the sly
Summary: media-libs/libsdl tampers with screensaver (session locking and power managem...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-25 00:07 UTC by Erik
Modified: 2008-06-10 00:48 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch that removes the offending code from SDL-1.2.11. (libsdl-1.2.11-no-tamper-screensaver.patch,6.64 KB, patch)
2008-02-25 00:08 UTC, Erik
Details | Diff
Patch that removes the offending code from SDL-1.2.11. (libsdl-1.2.11-no-tamper-screensaver.patch,9.07 KB, patch)
2008-02-25 01:28 UTC, Erik
Details | Diff
Patch that removes the offending code from SDL-1.2.13. (libsdl-1.2.13-no-tamper-screensaver.patch,13.37 KB, patch)
2008-02-25 01:29 UTC, Erik
Details | Diff
Patch that makes the bug optional. (confopt-disable-screensaver.patch,9.80 KB, patch)
2008-02-26 16:20 UTC, Erik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik 2008-02-25 00:07:10 UTC
media-libs/libsdl tampers with screensaver settings on the sly. It simply disables the screensaver whenever SDL is intialized in a program. It tries to restore the setting when it exits, but this does not work on my system at least. So the screen stays on forever after staring an SDL program, even if it was closed again long time ago. This not only annoys, wears out display hardware, shortens battery time and wastes energy. It also has security implications. Many users rely on the screensaver starting when they have not used the workstation for a certain period of time. If I am gone from my workstation for longer than 1 minute, I might be out of sight. I must be certain that it will lock my session in that case. I can not tolerate that any program disables this important feature, especially not unwanted, on the sly and in a library, thus affecting all programs using it.

I made a patch against SDL-1.2.11, which is the current stable version in portage. The patch removes the offending code from SDL.

Reproducible: Always

Steps to Reproduce:
Comment 1 Erik 2008-02-25 00:08:17 UTC
Created attachment 144547 [details, diff]
Patch that removes the offending code from SDL-1.2.11.
Comment 2 Erik 2008-02-25 01:28:48 UTC
Created attachment 144551 [details, diff]
Patch that removes the offending code from SDL-1.2.11.
Comment 3 Erik 2008-02-25 01:29:49 UTC
Created attachment 144552 [details, diff]
Patch that removes the offending code from SDL-1.2.13.
Comment 4 SpanKY gentoo-dev 2008-02-25 19:52:44 UTC
Comment on attachment 144552 [details, diff]
Patch that removes the offending code from SDL-1.2.13.

wholesale disabling isnt an option

you can:
 - add an env var to control (SDL_NO_XSCREENSAVER)
 - figure out why it's not working on your system
Comment 5 Erik 2008-02-25 22:00:46 UTC
(In reply to comment #4)
> (From update of attachment 144552 [details, diff] [edit])
> wholesale disabling isnt an option

It works. Could you explain what problem you see?


> you can:
>  - add an env var to control (SDL_NO_XSCREENSAVER)

That is what SDL-1.2.13 does, but why should we need that workaround when we can just get rid of the bug completely with this patch?


>  - figure out why it's not working on your system

It is not working because of the code, that the patches remove. What SDL does is just a really ugly hack that we would do much better without.
Comment 6 Erik 2008-02-26 16:20:35 UTC
Created attachment 144682 [details, diff]
Patch that makes the bug optional.

(In reply to comment #5)
> (In reply to comment #4)
> > (From update of attachment 144552 [details, diff] [edit] [edit])
> > wholesale disabling isnt an option
> 
> It works. Could you explain what problem you see?

Someone on the SDL list explained that the code causing this bug exists to work around some problems with X11. So here is a patch that makes it configurable. Just apply it and connect it to a USE-flag "sdldisablescreensaver".
Comment 7 SpanKY gentoo-dev 2008-02-27 10:01:00 UTC
lemme rephrase then: we're not adding anything to sdl along these lines that isnt merged upstream

backports from current upstream svn trunk is fine; diverging is not
Comment 8 Erik 2008-02-27 10:02:52 UTC
We found out that the thing that SDL tries to do, calling DPMSDisable at startup and then DPMSEnable at shutdown, does not work at all on xorg, due to this bug:
http://bugs.freedesktop.org/show_bug.cgi?id=13962

The reason that DPMSEnable works in kcontrol is that it calls DPMSSetTimeouts immediately after:
http://websvn.kde.org/tags/KDE/3.5.9/kdebase/kcontrol/energy/energy.cpp?annotate=774532#l343
Comment 9 Mr. Bones. (RETIRED) gentoo-dev 2008-06-10 00:48:13 UTC
comment #7 makes it pretty clear this is UPSTREAM.