From: <ag...@us...> - 2009-09-15 17:59:45
|
Revision: 974 http://zoolib.svn.sourceforge.net/zoolib/?rev=974&view=rev Author: agreen Date: 2009-09-15 17:59:23 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Use the client rect, not the structure bounds to size the plugin. Modified Paths: -------------- trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.cpp trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.h Modified: trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.cpp =================================================================== --- trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.cpp 2009-09-08 17:40:10 UTC (rev 973) +++ trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.cpp 2009-09-15 17:59:23 UTC (rev 974) @@ -126,7 +126,7 @@ else { fNPWindow.type = NPWindowTypeDrawable; - fNPWindow.window = fInnerWND; + fNPWindow.window = nullptr; } this->pStuffNPWindow(theWidth, theHeight); @@ -137,6 +137,7 @@ LRESULT Host_Win::WindowProc(HWND iHWND, UINT iMessage, WPARAM iWPARAM, LPARAM iLPARAM) { +#if 0 // From WebCore's PluginViewWin.cpp switch (iMessage) { @@ -155,6 +156,7 @@ break; } } +#endif //-- @@ -181,27 +183,30 @@ case WM_WINDOWPOSCHANGED: { WINDOWPOS* theWPOS = reinterpret_cast<WINDOWPOS*>(iLPARAM); + if (!(theWPOS->flags & SWP_NOSIZE)) { - this->pStuffNPWindow( - theWPOS->cx, - theWPOS->cy); + RECT theCR; + ::GetClientRect(iHWND, &theCR); + const int theWidth = theCR.right - theCR.left; + const int theHeight = theCR.bottom - theCR.top; if (fInnerWND) { ::SetWindowPos(fInnerWND, nullptr, - 0, 0, theWPOS->cx, theWPOS->cy, + 0, 0, theWidth, theHeight, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); } else { - RECT theCR; - ::GetClientRect(iHWND, &theCR); ::InvalidateRect(fHWND, &theCR, false); } - } + + this->pStuffNPWindow(theWidth, theHeight); + } break; } + case WM_ACTIVATE: case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: case WM_RBUTTONDBLCLK: @@ -239,8 +244,7 @@ void Host_Win::pPaint(HWND iHWND, WPARAM iWPARAM, LPARAM iLPARAM) { - if (ZLOG(s, eDebug, "Host_Win")) - s << "+pPaint"; + ZLOGFUNCTION(eDebug + 3); PAINTSTRUCT thePS; HDC theHDC = ::BeginPaint(iHWND, &thePS); @@ -263,9 +267,6 @@ } ::EndPaint(iHWND, &thePS); - - if (ZLOG(s, eDebug, "Host_Win")) - s << "-pPaint"; } void Host_Win::pStuffNPWindow(int iWidth, int iHeight) Modified: trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.h =================================================================== --- trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.h 2009-09-08 17:40:10 UTC (rev 973) +++ trunk/zoolib/source/cxx/more/zoolib/netscape/ZNetscape_Host_Win.h 2009-09-15 17:59:23 UTC (rev 974) @@ -62,7 +62,6 @@ void pPaint(HWND iHWND, WPARAM iWPARAM, LPARAM iLPARAM); void pStuffNPWindow(int iWidth, int iHeight); -// HWND fWND; bool fIsWindowed; bool fIsTransparent; NPWindow fNPWindow; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |