diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index b4fc24aeb3..a000b07892 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -210,6 +210,12 @@ protected: void handleUnicodeUTF16(U16 utf16, MASK mask); friend class LLWindowManager; + +// Allow to query for window chrome sizes. Default it none, only win32 windows override this. +public: + virtual void getWindowChrome( U32 &aChromeW, U32 &aChromeH ) + { aChromeW = aChromeH = 0; } +// }; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index e820bddec8..d234c6f707 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3837,5 +3837,24 @@ std::vector LLWindowWin32::getDynamicFallbackFontList() return std::vector(); } +// Allow to query for window chrome sizes. +void LLWindowWin32::getWindowChrome( U32 &aChromeW, U32 &aChromeH ) +{ + LLWindow::getWindowChrome( aChromeW, aChromeH ); + + RECT oClient, oWindow; + + if( !::GetClientRect( mWindowHandle, &oClient ) || !::GetWindowRect( mWindowHandle, &oWindow ) ) + return; + + U32 nHeight = oWindow.bottom - oWindow.top; + U32 nWidth = oWindow.right - oWindow.left; + U32 nCHeight = oClient.bottom - oClient.top; + U32 nCWidth = oClient.right - oClient.left; + + aChromeW = nWidth - nCWidth; + aChromeH = nHeight - nCHeight; +} +// #endif // LL_WINDOWS diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 438cca5b74..6355ebde23 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -214,6 +214,10 @@ protected: U32 mKeyVirtualKey; friend class LLWindowManager; +// Allow to query for window chrome sizes. +public: + virtual void getWindowChrome( U32 &aChromeW, U32 &aChromeH ); +// }; class LLSplashScreenWin32 : public LLSplashScreen diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index df259cfab2..36443fc402 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4299,15 +4299,12 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) // { // gViewerWindow->getWindow()->setSize(new_size.convert()); // } -#ifdef LL_WINDOWS - // The Windows functions get the size wrong. The OS X and Linux - // versions don't. - new_width += 16; - new_height += 38; -#endif // LL_WINDOWS + U32 nChromeW(0), nChromeH(0); + gViewerWindow->getWindow()->getWindowChrome( nChromeW, nChromeH ); + LLCoordScreen new_size; - new_size.mX = new_width; - new_size.mY = new_height; + new_size.mX = new_width + nChromeW; + new_size.mY = new_height + nChromeH; gViewerWindow->getWindow()->setSize(new_size); // FS:TS FIRE-6182 end }