[SDL] SDL tampers with display power settings on the sly

Erik esigra at gmail.com
Sun Feb 24 13:26:10 PST 2008


Alan Swanson skrev:
> On Sat, 2008-02-23 at 04:22 +0100, Erik wrote:
>   
>> SDL tampers with the power management settings of my display on the sly. 
>> After running an SDL program, the display never turns off. It should turn
>> off after a minute of inactivity. I have to go to 
>> kcontrol->peripherals->display->powersave, change something, change it 
>> back and press Apply. Then the power management is restored.
>>     
>
> Disabling the screensaver for X11 was introduced in SDL 1.2.10 and is
> setup in the src/video/x11/SDL_x11video.c and
> src/video/x11/SDL_x11events.c files. You can stop the disabling of
> screensaver by setting the SDL_VIDEO_ALLOW_SCREENSAVER environment
> variable added in SDL 1.2.12.
>   
That was certainly a very bad thing to do! If a user has configured a 
screensaver, he wants his setting to be obeyed. That is definitely 
nothing that some library should mess around with on the sly. It might 
be acceptable for application to give the user an option to disable the 
screensaver (movie player comes to mind). That is on the application 
level, but doing it on the library level is just insane!

> However the problem you are noticing I have observed too, the screensaver was not being restored after exiting any SDL program.
>   
How is it supposed to work? I know that there are mechanisms for closing 
files that programs have left open when they end and reclaiming memory 
that programs have not deallocated before  they end, but how is the 
system supposed to restore display settings that a program has manipulated?


More information about the SDL mailing list