Beta 31 disables KDE4 screensaver (common to many SDL apps).

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
dirkmitt
Yeek
Posts: 11
Joined: Thu Jul 28, 2011 1:32 am

Beta 31 disables KDE4 screensaver (common to many SDL apps).

#1 Post by dirkmitt »

One critical bug in version Beta-31, is that under KDE4 it disables the screensaver for the duration of the session.
This means that in practice, after each game session, I'd need to reboot my computer in order for the screensaver to work again. And if I simply attempt to reset the screensaver settings, then the next time mouse or keyboard activity interrupts the screensaver, I don't get to see my unlock box again.

In such an attempted workaround I need to <Ctrl>+<Alt>+<F1> and then kill -9 the screen locking process, from this console mode.

I've observed that some SDL apps simply seem to do this, while most others don't, and have never been able to figure out why.

But, having to reboot after every game, is in itself enough to deter me from playing.

Dirk

dirkmitt
Yeek
Posts: 11
Joined: Thu Jul 28, 2011 1:32 am

Re: Beta 31 disables KDE4 screensaver (common to many SDL ap

#2 Post by dirkmitt »

I think that I might be affected by this bug:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458813

Under Debian / Lenny, my libsdl version is 1.2.13-2 , whereas this bug was fixed in libsdl 1.2.13-3 .

What seems to be possible under this bug, is that SDL apps use the environment variable

SDL_VIDEO_ALLOW_SCREENSAVER

in order to avoid disabling the screensaver in the first place. But the buggy earlier version of SDL would disable the screensaver on initialization, before testing this environment variable. And the net effect would be, that when the program exits, it fails to re-enable the screensaver, because on exit the (SDL) code does test the environment variable. So it wouldn't be the fault of the game designer. And games which left SDL at its default behavior of disabling the screensaver for the duration of one game, would also successfully re-enable it, without any explicit code having been put at all.

If my theory is correct, then "ToME" may use the environment variable SDL_VIDEO_ALLOW_SCREENSAVER somewhere. Is this true? And if so, where could I comment it out? If you used it, then maybe you could point me to where in the code you used it?

Dirk

dirkmitt
Yeek
Posts: 11
Joined: Thu Jul 28, 2011 1:32 am

Re: Beta 31 disables KDE4 screensaver (common to many SDL ap

#3 Post by dirkmitt »

(Sorry for the self-replied postings.)

I believe that I've just disproved my own hypothesis. In the file 'src/main.c' , I just made this line the first line of the function main() :

Code: Select all

unsetenv("SDL_VIDEO_ALLOW_SCREENSAVER");
And this line of code has not changed the screensaver-killing behavior of the game. Therefore, there must be some other reason for it.

Nevertheless, I have some other games based on SDL, which don't kill my screensaver. And I've been trying to eyeball what differences there might be in the code, due to which the other ones don't. But this effort has been without any real success so far. Maybe my version of SDL just doesn't like the 'SDL_SetVideoMode()' in ToME?

Dirk

Edit: I now think that I know which 'SDL_SetVideoMode()' flag my screensaver management doesn't like:

SDL_OPENGL

I think that the pattern which has emerged, is that the SDL-based games will leave my screensaver alone, which aren't also OpenGL. And I believe that leaves me without a solution.

Post Reply