Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.0
-
None
-
234e849cfc85d5618d2f703bb92701042993d2de
Description
On Win32, when compressing the WM_MOUSEMOVE events, sometimes the wrong coordinate is used. This happens when another app, is simulating events to the Qt Widget by using PostMessage() to post WM_MOUSEMOVE events to the application. The LPARAM has the correct coordinates.
Here is a patch to resolve the issue:
--- src\gui\kernel\qapplication_win.cpp 2010-01-26 07:26:26.348949500 -0800 +++ src\gui\kernel\qapplication_win.cpp_ 2010-01-26 07:30:52.175529500 -0800 @@ -2943,6 +2943,15 @@ MSG *msgPtr = (MSG *)(&msg); // Update the passed in MSG structure with the // most recent one. + // NOTE: The pt in the MSG structure received from + // PeekMessage is sometimes incorrect. Specifically + // if the WM_MOUSEMOVE messages are being posted + // from a different process. The LPARAM seems + // to always be correct though, so use that + // to update the pt.x and pt.y fields. + mouseMsg.pt.x = GET_X_LPARAM(mouseMsg.lParam); + mouseMsg.pt.y = GET_Y_LPARAM(mouseMsg.lParam); + ClientToScreen(mouseMsg.hwnd, &mouseMsg.pt); msgPtr->lParam = mouseMsg.lParam; msgPtr->wParam = mouseMsg.wParam; msgPtr->pt = mouseMsg.pt;