From 16a52882e7b64bfa962fec365a0d1b341d038f39 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 12 Sep 2013 19:25:25 +0200 Subject: [PATCH] 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 --- src/gui/kernel/qguiapplication.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 1186cc2905f..882eefb60e7 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