diff --git a/layout/generic/test/test_plugin_mouse_coords.html b/layout/generic/test/test_plugin_mouse_coords.html index 7872d32a694..c9fb5c364ad 100644 --- a/layout/generic/test/test_plugin_mouse_coords.html +++ b/layout/generic/test/test_plugin_mouse_coords.html @@ -68,7 +68,7 @@ function doTest() { } // Need to run 'doTest' after painting is unsuppressed, or we'll set clip // regions to empty. -addLoadEvent(function() { setTimeout(doTest, 0); } ); +addLoadEvent(function() { setTimeout(doTest, 1000); } ); SimpleTest.waitForExplicitFinish(); diff --git a/modules/plugin/test/testplugin/nptest.h b/modules/plugin/test/testplugin/nptest.h index b68d32f3d42..e56ce11ec3e 100644 --- a/modules/plugin/test/testplugin/nptest.h +++ b/modules/plugin/test/testplugin/nptest.h @@ -94,6 +94,8 @@ typedef struct InstanceData { bool throwOnNextInvoke; uint32_t timerID1; uint32_t timerID2; + int32_t winX; + int32_t winY; int32_t lastMouseX; int32_t lastMouseY; int32_t widthAtLastPaint; diff --git a/modules/plugin/test/testplugin/nptest_windows.cpp b/modules/plugin/test/testplugin/nptest_windows.cpp index d9d5c43ac50..40c7c11c7f1 100644 --- a/modules/plugin/test/testplugin/nptest_windows.cpp +++ b/modules/plugin/test/testplugin/nptest_windows.cpp @@ -413,6 +413,17 @@ handleEventInternal(InstanceData* instanceData, NPEvent* pe, LRESULT* result) case WM_MOUSEWHEEL: return true; + case WM_WINDOWPOSCHANGED: { + WINDOWPOS* pPos = (WINDOWPOS*)pe->lParam; + instanceData->winX = instanceData->winY = 0; + if (pPos) { + instanceData->winX = pPos->x; + instanceData->winY = pPos->y; + return true; + } + return false; + } + case WM_MOUSEMOVE: case WM_LBUTTONDOWN: case WM_LBUTTONUP: @@ -420,8 +431,8 @@ handleEventInternal(InstanceData* instanceData, NPEvent* pe, LRESULT* result) case WM_MBUTTONUP: case WM_RBUTTONDOWN: case WM_RBUTTONUP: { - int x = instanceData->hasWidget ? 0 : instanceData->window.x; - int y = instanceData->hasWidget ? 0 : instanceData->window.y; + int x = instanceData->hasWidget ? 0 : instanceData->winX; + int y = instanceData->hasWidget ? 0 : instanceData->winY; instanceData->lastMouseX = GET_X_LPARAM(pe->lParam) - x; instanceData->lastMouseY = GET_Y_LPARAM(pe->lParam) - y; return true;