From 9da67fff0a21ae7af2f99c90be267b089eaafeb6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 23 Feb 2012 12:39:32 -0800 Subject: EXP-1832 FIX Viewer Size not persistent across logins made Set Window Size correctly set interior window rect, preserving measured dimensions --- indra/llwindow/llwindowmacosx.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/llwindow/llwindowmacosx.cpp') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index c952f8bbcf..a998d1f877 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1266,6 +1266,19 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordScreen size) return TRUE; } +BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size) +{ + Rect client_rect; + if (mWindow && GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr) + { + client_rect.right = client_rect.left + size.mX; + client_rect.bottom = client_rect.top + size.mY; + OSStatus err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect); + return err == noErr; + } + return FALSE; +} + void LLWindowMacOSX::swapBuffers() { aglSwapBuffers(mContext); -- cgit v1.2.3 From 8024727d4546c07b723d1129651c189f7d2f28e3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 27 Feb 2012 11:26:08 -0800 Subject: EXP-1832 WIP Viewer Size not persistent across logins fixed not unmaximizing properly on Windows put in error logging on Mac --- indra/llwindow/llwindowmacosx.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/llwindow/llwindowmacosx.cpp') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index a998d1f877..fef5f4da3b 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1271,10 +1271,22 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size) Rect client_rect; if (mWindow && GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr) { - client_rect.right = client_rect.left + size.mX; - client_rect.bottom = client_rect.top + size.mY; - OSStatus err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect); - return err == noErr; + OSStatus err = getWindowBounds(mWindow, kWindowContentRgn, &client_rect); + if (err == noErr) + { + client_rect.right = client_rect.left + size.mX; + client_rect.bottom = client_rect.top + size.mY; + err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect); + } + if (err == noErr) + { + return TRUE; + } + else + { + llinfos << "Error setting size" << err << llendl; + return FALSE; + } } return FALSE; } -- cgit v1.2.3 From 874a67776bb2e0ec3f0d5c79cae570830da91d56 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 27 Feb 2012 14:02:09 -0800 Subject: fix for mac build --- indra/llwindow/llwindowmacosx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llwindow/llwindowmacosx.cpp') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index fef5f4da3b..32bb84cba5 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1269,9 +1269,9 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordScreen size) BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size) { Rect client_rect; - if (mWindow && GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr) + if (mWindow) { - OSStatus err = getWindowBounds(mWindow, kWindowContentRgn, &client_rect); + OSStatus err = GetWindowBounds(mWindow, kWindowContentRgn, &client_rect); if (err == noErr) { client_rect.right = client_rect.left + size.mX; -- cgit v1.2.3