зеркало из https://github.com/mozilla/pjs.git
Bug 543201 - [OOPP] Shockwave window position is not correct. r=bent.
This commit is contained in:
Родитель
aaf1c7d03d
Коммит
1ac17e00d0
|
@ -662,6 +662,8 @@ PluginInstanceChild::SizePluginWindow(int width,
|
|||
int height)
|
||||
{
|
||||
if (mPluginWindowHWND) {
|
||||
mPluginSize.x = width;
|
||||
mPluginSize.y = height;
|
||||
SetWindowPos(mPluginWindowHWND, NULL, 0, 0, width, height,
|
||||
SWP_NOZORDER | SWP_NOREPOSITION);
|
||||
}
|
||||
|
@ -697,6 +699,27 @@ PluginInstanceChild::PluginWindowProc(HWND hWnd,
|
|||
|
||||
NS_ASSERTION(self->mPluginWindowHWND == hWnd, "Wrong window!");
|
||||
|
||||
// Adobe's shockwave positions the plugin window relative to the browser
|
||||
// frame when it initializes. With oopp disabled, this wouldn't have an
|
||||
// effect. With oopp, GeckoPluginWindow is a child of the parent plugin
|
||||
// window, so the move offsets the child within the parent. Generally
|
||||
// we don't want plugins moving or sizing our window, so we prevent these
|
||||
// changes here.
|
||||
if (message == WM_WINDOWPOSCHANGING) {
|
||||
WINDOWPOS* pos = reinterpret_cast<WINDOWPOS*>(lParam);
|
||||
if (pos && (!(pos->flags & SWP_NOMOVE) || !(pos->flags & SWP_NOSIZE))) {
|
||||
pos->x = pos->y = 0;
|
||||
pos->cx = self->mPluginSize.x;
|
||||
pos->cy = self->mPluginSize.y;
|
||||
LRESULT res = CallWindowProc(self->mPluginWndProc, hWnd, message, wParam,
|
||||
lParam);
|
||||
pos->x = pos->y = 0;
|
||||
pos->cx = self->mPluginSize.x;
|
||||
pos->cy = self->mPluginSize.y;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
// The plugin received keyboard focus, let the parent know so the dom is up to date.
|
||||
if (message == WM_MOUSEACTIVATE)
|
||||
self->CallPluginGotFocus();
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include "nsTArray.h"
|
||||
#include "ChildAsyncCall.h"
|
||||
#include "ChildTimer.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace plugins {
|
||||
|
@ -229,6 +230,7 @@ private:
|
|||
bool mNestedEventState;
|
||||
HWND mCachedWinlessPluginHWND;
|
||||
UINT_PTR mEventPumpTimer;
|
||||
nsIntPoint mPluginSize;
|
||||
#endif
|
||||
|
||||
friend class ChildAsyncCall;
|
||||
|
|
Загрузка…
Ссылка в новой задаче