Revert "QGuiApplication: don't send pointer events to windows other than the active popup"
This reverts commit 2e711e47e0fedd636af2116c56622cc7be958808. After closer investigation, it turns out that menus in Quick before 6.8 does infact forward pointer events outside the popup to the item under the mouse. Only if the popup is modal will this be blocked. So blocking this from QGuiApplication will cause a difference between Popup.Item and Popup.Window, and needs more investigation. Change-Id: I7d21258cb8fafd7380786fed0d6370e0a9090188 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
10680554db
commit
893dc6d772
@ -2444,16 +2444,14 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
|
||||
ev.setTimestamp(e->timestamp);
|
||||
|
||||
if (activePopup && activePopup != window && (!popup_closed_on_press || type == QEvent::MouseButtonRelease)) {
|
||||
// If the popup handles the event, we're done.
|
||||
auto *handlingPopup = window->d_func()->forwardToPopup(&ev, active_popup_on_press);
|
||||
if (handlingPopup && ev.isBeginEvent())
|
||||
if (handlingPopup) {
|
||||
if (type == QEvent::MouseButtonPress)
|
||||
active_popup_on_press = handlingPopup;
|
||||
// Regardless of whether the popup accepted the event or not, we return now so that we
|
||||
// don't forward it to the window under the mouse instead. We're only supposed to
|
||||
// do such forwarding if QPlatformIntegration::ReplayMousePressOutsidePopup is set,
|
||||
// but support for that is currently not reimplemented (it needs to be done in
|
||||
// conjunction with support for WA_NoMouseReplay). This is normally only wanted on Windows.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (doubleClick && (ev.type() == QEvent::MouseButtonPress)) {
|
||||
// QtBUG-25831, used to suppress delivery in qwidgetwindow.cpp
|
||||
@ -2977,14 +2975,8 @@ void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::T
|
||||
tabletEvent.setTimestamp(e->timestamp);
|
||||
|
||||
if (activePopup && activePopup != window) {
|
||||
auto *handlingPopup = window->d_func()->forwardToPopup(&tabletEvent, active_popup_on_press);
|
||||
if (handlingPopup && tabletEvent.isBeginEvent())
|
||||
active_popup_on_press = handlingPopup;
|
||||
// Regardless of whether the popup accepted the event or not, we return now so that we
|
||||
// don't forward it to the window under the mouse instead. We're only supposed to
|
||||
// do such forwarding if QPlatformIntegration::ReplayMousePressOutsidePopup is set,
|
||||
// but support for that is currently not reimplemented (it needs to be done in
|
||||
// conjunction with support for WA_NoMouseReplay). This is normally only wanted on Windows.
|
||||
// If the popup handles the event, we're done.
|
||||
if (window->d_func()->forwardToPopup(&tabletEvent, active_popup_on_press))
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user