summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index c0db4805df..8380aba13b 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -734,8 +734,20 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
msg.message = message; // time and pt fields ignored
msg.wParam = wParam;
msg.lParam = lParam;
- msg.pt.x = GET_X_LPARAM(lParam);
- msg.pt.y = GET_Y_LPARAM(lParam);
+ msg.pt.x = msg.pt.y = 0;
+ if (et != QtWindows::CursorEvent && (et & (QtWindows::MouseEventFlag | QtWindows::NonClientEventFlag))) {
+ msg.pt.x = GET_X_LPARAM(lParam);
+ msg.pt.y = GET_Y_LPARAM(lParam);
+ // For non-client-area messages, these are screen coordinates (as expected
+ // in the MSG structure), otherwise they are client coordinates.
+ if (!(et & QtWindows::NonClientEventFlag)) {
+ ClientToScreen(msg.hwnd, &msg.pt);
+ }
+ } else {
+#ifndef Q_OS_WINCE
+ GetCursorPos(&msg.pt);
+#endif
+ }
// Run the native event filters.
long filterResult = 0;