diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-09-12 19:25:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-13 09:22:42 +0200 |
commit | 16a52882e7b64bfa962fec365a0d1b341d038f39 (patch) | |
tree | 0af5c6dfd6c452f737d040bd6b3554e3f6ac74a2 /src/gui | |
parent | e013eba2037c49385918a0ab1324bf58a18ee173 (diff) |
Push updates to the QPA cursor even when a modal window is shown
Call QPlatformCursor::pointerEvent() even when the mouse event is
stopped due to being blocked by a modal window. This is necessary for
relatively dumb platforms, like eglfs, because the mouse cursor is
expected to be functional across the entire screen regardless of
having a modal dialog shown.
Platforms where the cursor is handled by the system (xcb, windows,
etc.) are not affected as they don't implement pointerEvent() anyway.
Change-Id: I4996ca0db23eb7f6ca3e2432d8d7abb1a5113dca
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 1186cc2905..882eefb60e 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1558,11 +1558,6 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (!window) return; - if (window->d_func()->blockedByModalWindow) { - // a modal window is blocking this window, don't allow mouse events through - return; - } - QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers); ev.setTimestamp(e->timestamp); #ifndef QT_NO_CURSOR @@ -1570,6 +1565,12 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (QPlatformCursor *cursor = screen->handle()->cursor()) cursor->pointerEvent(ev); #endif + + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow mouse events through + return; + } + QGuiApplication::sendSpontaneousEvent(window, &ev); if (!e->synthetic && !ev.isAccepted() && !frameStrut |