From 4c333d64ca7ac516dc0d3c5830b4488e30db6d27 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 Feb 2012 15:45:43 -0800 Subject: EXP-1832 FIX Viewer Size not persistent across logins Save *window* width and height, not client area --- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/llviewerwindow.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index caeaf71484..b7e2f636d4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12777,7 +12777,7 @@ WindowX Comment - X coordinate of lower left corner of SL viewer window, relative to primary display (pixels) + X coordinate of upper left corner of SL viewer window, relative to upper left corner of primary display (pixels) Persist 1 Type @@ -12788,7 +12788,7 @@ WindowY Comment - Y coordinate of lower left corner of SL viewer window, relative to primary display (pixels) + Y coordinate of upper left corner of SL viewer window, relative to upper left corner of primary display (pixels) Persist 1 Type diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f5a226b781..ab20ff1d42 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2159,9 +2159,13 @@ void LLViewerWindow::reshape(S32 width, S32 height) // tell the OS specific window code about min window size mWindow->setMinSize(min_window_width, min_window_height); - // Only save size if not maximized - gSavedSettings.setU32("WindowWidth", mWindowRectRaw.getWidth()); - gSavedSettings.setU32("WindowHeight", mWindowRectRaw.getHeight()); + LLCoordScreen window_rect; + if (mWindow->getSize(&window_rect)) + { + // Only save size if not maximized + gSavedSettings.setU32("WindowWidth", window_rect.mX); + gSavedSettings.setU32("WindowHeight", window_rect.mY); + } } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); -- cgit v1.2.3