Bug 590368. Pass SWP_NOCOPYBITS when moving a clipped plugin window with D3D9, to work around a Windows/driver bug. r=jmathies a=blocking

This commit is contained in:
Robert O'Callahan 2010-12-05 15:02:17 +00:00
Родитель e16594c52b
Коммит 6260cae31b
1 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -233,6 +233,7 @@
#include "nsIXULRuntime.h"
using namespace mozilla::widget;
using namespace mozilla::layers;
/**************************************************************
**************************************************************
@ -1392,8 +1393,19 @@ NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
}
#endif
ClearThemeRegion();
VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, 0, 0,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE));
UINT flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE;
// Workaround SetWindowPos bug with D3D9. If our window has a clip
// region, some drivers or OSes may incorrectly copy into the clipped-out
// area.
if (mWindowType == eWindowType_plugin &&
(!mLayerManager || mLayerManager->GetBackendType() == LayerManager::LAYERS_D3D9) &&
mClipRects &&
(mClipRectCount != 1 || mClipRects[0] != nsIntRect(0, 0, mBounds.width, mBounds.height))) {
flags |= SWP_NOCOPYBITS;
}
VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, 0, 0, flags));
SetThemeRegion();
}
return NS_OK;