summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastian Eifert <eifert@gmail.com>2013-05-30 19:13:32 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-12 12:42:59 +0200
commit7ae6e48d57f89596ddf40980aeff4ef7340ba689 (patch)
tree672228b320ba041fd6f95e552435f7840aed3ebd /src/plugins
parent0d459619a902e547d8c74745453b3bdb8f67a660 (diff)
Windows: Prevent spurious leave events.
When behind a mouse-event-transparent window, synthesized leave events are emitted, because the transparent window is considered as the window under the mouse, not the Qt window. This change skips transparent windows when searching for the window under the mouse. Task-number: QTBUG-31464 Change-Id: I85c8b46a1af37b4d1c5d1d77566ab045657aa9ae Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qplatformfunctions_wince.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qplatformfunctions_wince.h b/src/plugins/platforms/windows/qplatformfunctions_wince.h
index 3190e39ec5..30fc66563e 100644
--- a/src/plugins/platforms/windows/qplatformfunctions_wince.h
+++ b/src/plugins/platforms/windows/qplatformfunctions_wince.h
@@ -74,6 +74,7 @@
#ifndef CWP_SKIPINVISIBLE
#define CWP_SKIPINVISIBLE 0x0001
+#define CWP_SKIPTRANSPARENT 0x0004
#define findPlatformWindowAt(a, b, c) findPlatformWindowAt(a, b)
#endif
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index 5c096b7eca..c6cfa4dbbc 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -232,8 +232,10 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
}
const QPoint globalPosition = QWindowsGeometryHint::mapToGlobal(hwnd, winEventPosition);
+ // In this context, neither an invisible nor a transparent window (transparent regarding mouse
+ // events, "click-through") can be considered as the window under mouse.
QWindow *currentWindowUnderMouse = platformWindow->hasMouseCapture() ?
- QWindowsScreen::windowAt(globalPosition) : window;
+ QWindowsScreen::windowAt(globalPosition, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT) : window;
compressMouseMove(&msg);
// Qt expects the platform plugin to capture the mouse on