From 1f1304c6623bfddc753f93b7645f097f85ea699c Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Fri, 17 Dec 2010 17:47:37 +0000 Subject: [PATCH] No longer forcing centered window position. SF.net Bug #3138446 --- docs/CHANGES.txt | 9 ++++++++- src/tuxpaint.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 4b296681e..6056e0a0d 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2010.December.15 (0.9.22) +2010.December.17 (0.9.22) * New Tools: ---------- * Label - A tool to add text to a drawing, which can be modified or @@ -50,10 +50,17 @@ $Id$ * Other Improvements: ------------------- + * Tux Paint (in windowed mode) now only centers itself if + no specific positioning has been provided via + the SDL_VIDEO_WINDOW_POS environment variable. + (SourceForge Bug #3138446) + * Adding a mouse mode to avoid the need to drag the mouse. + FIXME: Explain by Ankit Choudary * Allowing to paint with the keyboard. + FIXME: Explain by Ankit Choudary. * Creating thumbnails for the starters we provide. diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 9a7492eca..b8b347d4d 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -21845,7 +21845,12 @@ static void setup(void) if (!fullscreen) { - putenv((char *) "SDL_VIDEO_WINDOW_POS=center"); + int set_window_pos = 0; + if (getenv((char *) "SDL_VIDEO_WINDOW_POS") == NULL) + { + set_window_pos = 1; + putenv((char *) "SDL_VIDEO_WINDOW_POS=center"); + } #ifdef USE_HWSURFACE screen = SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, @@ -21855,7 +21860,8 @@ static void setup(void) VIDEO_BPP, SDL_SWSURFACE); #endif - putenv((char *) "SDL_VIDEO_WINDOW_POS=nopref"); + if (set_window_pos) + putenv((char *) "SDL_VIDEO_WINDOW_POS=nopref"); } if (screen == NULL)