Screensaver in fullscreen SDL app on Mac OS X

I just got a note from someone who’s been trying to get their screensaver
to come back on when Tux Paint is running in full-screen mode.

They had already tried poking at the SDL_VIDEO_ALLOW_SCREENSAVER environment
variable manually, and I told them to try setting the "allow screensaver"
option in Tux Paint, which also sets that env. var., just in case.
(Off the top of my head, I have very little idea how to set an env var on
a Mac and launch Tux Paint. From Terminal, I guess…?)

No luck there. It works when Tux Paint is in windowed mode, but not
when it’s full-screen. What gives? A bug in SDL? Some other tweak we
need to do within Tux Paint?

We init SDL with:
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO);

And, to the best of my knowledge[*], we open the fullscreen display with:

screen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT,
                          32, SDL_FULLSCREEN | SDL_SWSURFACE);

[*] I don’t see anything obvious that would lead me to believe otherwise.
We do have a “USE_HWSURFACE”, but I didn’t see hints of it being mentioned
within the ‘macosx/’ project folder in Tux Paint’s source…–
-bill!
Sent from my computer

Could it simply be that Mac OS X simply doesn’t support the
screensaver during fullscreen apps? Or at least the way SDL acquires a
fullscreen context?–

  • SR

On Tue, Sep 29, 2009 at 16:18, Bill Kendrick wrote:

I just got a note from someone who’s been trying to get their screensaver
to come back on when Tux Paint is running in full-screen mode.

They had already tried poking at the SDL_VIDEO_ALLOW_SCREENSAVER environment
variable manually, and I told them to try setting the "allow screensaver"
option in Tux Paint, which also sets that env. var., just in case.
(Off the top of my head, I have very little idea how to set an env var on
a Mac and launch Tux Paint. ?From Terminal, I guess…?)

No luck there. ?It works when Tux Paint is in windowed mode, but not
when it’s full-screen. ?What gives? ?A bug in SDL? ?Some other tweak we
need to do within Tux Paint?

We init SDL with:
?SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO);

And, to the best of my knowledge[*], we open the fullscreen display with:

? ?screen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?32, SDL_FULLSCREEN | SDL_SWSURFACE);

[*] I don’t see anything obvious that would lead me to believe otherwise.
? ?We do have a “USE_HWSURFACE”, but I didn’t see hints of it being mentioned
? ?within the ‘macosx/’ project folder in Tux Paint’s source…


-bill!
Sent from my computer


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I dunno! It’d be good if I knew, so I could inform people that it won’t
work. It might even be useful to add a built-in screensaver mode in
Tux Paint. shrug

-bill!On Tue, Sep 29, 2009 at 05:55:21PM -0400, Simon Roby wrote:

Could it simply be that Mac OS X simply doesn’t support the
screensaver during fullscreen apps? Or at least the way SDL acquires a
fullscreen context?

I dunno! It’d be good if I knew, so I could inform people that it won’t
work. It might even be useful to add a built-in screensaver mode in
Tux Paint. shrug

We call UpdateSystemActivity(UsrActivity) every five seconds inside
QZ_PumpEvents() unless you instruct us not to with the usual environment
variable…this is the programmatic way on Mac OS X to wiggle the mouse,
basically…so our explicit attempt to control the screen saver is not a
fullscreen/window thing in SDL itself.

But I suspect our use of CGDisplayCapture() for fullscreen mode turns
off (or conceals?) the screen saver. If this is true, I don’t know how
to fix this. Anyone?

–ryan.

Going once… going twice…? :slight_smile:

-bill!On Wed, Sep 30, 2009 at 02:44:03AM -0400, Ryan C. Gordon wrote:

I dunno! It’d be good if I knew, so I could inform people that it won’t
work. It might even be useful to add a built-in screensaver mode in
Tux Paint. shrug

We call UpdateSystemActivity(UsrActivity) every five seconds inside
QZ_PumpEvents() unless you instruct us not to with the usual environment
variable…this is the programmatic way on Mac OS X to wiggle the mouse,
basically…so our explicit attempt to control the screen saver is not a
fullscreen/window thing in SDL itself.

But I suspect our use of CGDisplayCapture() for fullscreen mode turns
off (or conceals?) the screen saver. If this is true, I don’t know how
to fix this. Anyone?