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>
This commit is contained in:
parent
e013eba203
commit
16a52882e7
@ -1558,11 +1558,6 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
|
|||||||
if (!window)
|
if (!window)
|
||||||
return;
|
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);
|
QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers);
|
||||||
ev.setTimestamp(e->timestamp);
|
ev.setTimestamp(e->timestamp);
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
@ -1570,6 +1565,12 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
|
|||||||
if (QPlatformCursor *cursor = screen->handle()->cursor())
|
if (QPlatformCursor *cursor = screen->handle()->cursor())
|
||||||
cursor->pointerEvent(ev);
|
cursor->pointerEvent(ev);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (window->d_func()->blockedByModalWindow) {
|
||||||
|
// a modal window is blocking this window, don't allow mouse events through
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QGuiApplication::sendSpontaneousEvent(window, &ev);
|
QGuiApplication::sendSpontaneousEvent(window, &ev);
|
||||||
if (!e->synthetic && !ev.isAccepted()
|
if (!e->synthetic && !ev.isAccepted()
|
||||||
&& !frameStrut
|
&& !frameStrut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user