diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index c6a68ebb1..7ef5645fe 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -28,6 +28,9 @@ $Id$ Discovered (or assumed) window size and directory settings are shown when tuxpaint-import is first run (even with no arguments). + + * In windowed mode, Tux Paint tries to open its window in the center + of the screen (if supported by the OS or window manager). * Tool improvements: ------------------------ diff --git a/src/tuxpaint.c b/src/tuxpaint.c index c4675306c..88183f31b 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - February 17, 2006 + June 14, 2002 - February 19, 2006 $Id$ */ @@ -323,6 +323,8 @@ extern WrapperData macosx; #define SDL_mutexV(lock) // release lock #endif +#include "SDL_getenv.h" + #include "i18n.h" #include "cursor.h" #include "pixels.h" @@ -6060,6 +6062,8 @@ static void setup(int argc, char * argv[]) if (!fullscreen) { + putenv((char *) "SDL_VIDEO_WINDOW_POS=center"); + #ifdef USE_HWSURFACE screen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, VIDEO_BPP, SDL_HWSURFACE); @@ -6067,6 +6071,8 @@ static void setup(int argc, char * argv[]) screen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, VIDEO_BPP, SDL_SWSURFACE); #endif + + putenv((char *) "SDL_VIDEO_WINDOW_POS=nopref"); } if (screen == NULL)