EXP-1832 WIP Viewer Size not persistent across logins

fixed not unmaximizing properly on Windows
put in error logging on Mac
meow-7.2.2
Richard Linden 2012-02-27 11:26:08 -08:00
parent 4e24022b8c
commit 8024727d45
2 changed files with 25 additions and 4 deletions

View File

@ -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;
}

View File

@ -872,6 +872,15 @@ BOOL LLWindowWin32::setSizeImpl(const LLCoordScreen size)
return FALSE;
}
WINDOWPLACEMENT placement;
placement.length = sizeof(WINDOWPLACEMENT);
if (!GetWindowPlacement(mWindowHandle, &placement)) return FALSE;
placement.showCmd = SW_RESTORE;
if (!SetWindowPlacement(mWindowHandle, &placement)) return FALSE;
moveWindow(position, size);
return TRUE;
}