diff options
author | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-11-05 12:00:18 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-11-18 14:11:21 +0000 |
commit | c87f3b22920b43347354ccf9e67f8b4cb6ea8c01 (patch) | |
tree | 0a04dc629872124eb9ed1832325a69b7cbc80a4e /src/gui/kernel | |
parent | d98415dd6b7219d853571f135cf7373de2c3a7c2 (diff) |
Call QPlatformCursor::pointerEvent with native coordinates.
It's a QPlatform* class and works in the native (platform)
coordinate system.
Change-Id: Ibf36bc68d84ecd668b35e0c22e1fa35cfc456a5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c5762fe1ee..00bad52432 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1821,16 +1821,23 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (!window) return; - QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source); - ev.setTimestamp(e->timestamp); #ifndef QT_NO_CURSOR if (!e->synthetic()) { if (const QScreen *screen = window->screen()) - if (QPlatformCursor *cursor = screen->handle()->cursor()) + if (QPlatformCursor *cursor = screen->handle()->cursor()) { + const QPointF nativeLocalPoint = QHighDpi::toNativePixels(localPoint, screen); + const QPointF nativeGlobalPoint = QHighDpi::toNativePixels(globalPoint, screen); + QMouseEvent ev(type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint, + button, buttons, e->modifiers, e->source); + ev.setTimestamp(e->timestamp); cursor->pointerEvent(ev); + } } #endif + QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source); + ev.setTimestamp(e->timestamp); + if (window->d_func()->blockedByModalWindow) { // a modal window is blocking this window, don't allow mouse events through return; |