diff --git a/dwscr.cc b/dwscr.cc index f8ca313..3f0f2e0 100644 --- a/dwscr.cc +++ b/dwscr.cc @@ -37,13 +37,6 @@ int main(int argc, char * argv[]) start = true; #endif - /* make the SDL window appear in the top-left corner of the screen */ - putenv("SDL_VIDEO_WINDOW_POS=0,0"); - - /* do not disable power management (this will allow monitors - * to power off at the normally configured timeout) */ - putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1"); - getDisplaySize(&width, &height); /* extremely simple command-line argument handling */ @@ -67,6 +60,14 @@ int main(int argc, char * argv[]) } } + /* make the SDL window appear in the top-left corner of the screen */ + if (!windowed) + putenv("SDL_VIDEO_WINDOW_POS=0,0"); + + /* do not disable power management (this will allow monitors + * to power off at the normally configured timeout) */ + putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1"); + if (!start) return 0; @@ -102,7 +103,8 @@ int main(int argc, char * argv[]) /* after our window is created and SDL and OpenGL are initialized, * start the main screensaver functionality */ - SSMain ss(width, height, getNumMonitors(), sdlSurface); + int num_monitors = windowed ? 1 : getNumMonitors(); + SSMain ss(width, height, num_monitors, sdlSurface); ss.run(); SDL_Quit();