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:
Created attachment 144547 [details, diff] Patch that removes the offending code from SDL-1.2.11.
Created attachment 144551 [details, diff] Patch that removes the offending code from SDL-1.2.11.
Created attachment 144552 [details, diff] Patch that removes the offending code from SDL-1.2.13.
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
(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.
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".
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
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 #7 makes it pretty clear this is UPSTREAM.