[SDL] SDL tampers with display power settings on the sly
swanson at ukfsn.org
Sun Feb 24 11:56:16 PST 2008
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.
However the problem you are noticing I have observed too, the
screensaver was not being restored after exiting any SDL program.
The SDL code all looks fine so I'd wondered if it was the programs fault
not exiting cleanly.
> So I have to keep a kcontrol instance open all the time and do that
> after running an SDL program. This is annoying, but it was much worse
> before I knew that it was SDL programs that caused it.
> To reproduce:
> 1. Wait a minute until the display turns off, to check that the power
> management is working properly.
You can use "xset q" to check the screensaver settings.
> 2. Build and run any SDL program, such as the attached testcase (gcc
> -Wall -Wextra -I/usr/include/SDL prov.c -lSDL -o prov&&./prov).
> 3. Wait a minute to see that the power management has stopped working.
> 4. Switch to kcontrol->peripherals->display->powersave, change some
> setting, change it back and press Apply.
> 5. Wait a minute to see that the power management works again.
> The power management stops working when the SDL program is started and
> remains dysfunctional even after the SDL-program has been closed.
Oddly it's all working fine at the moment both for test program and real
programs. Will need to retest but I wonder if it was driver issue. I've
updated to the current xf86-video-ati Git today.
"One must never be purposelessnessnesslessness."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the SDL