Skip to content

Commit

Permalink
QGestureManager: use gesture owner target if topLevelAt returns nullptr
Browse files Browse the repository at this point in the history
For security reason, Wayland doesn't provide global position for
top level windows, so topLevelAt is not supported.

Fixes: QTBUG-113404
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Id60b8b77a1843344db4d4e4c13382ad87adac806
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
liangqi committed Apr 22, 2024
1 parent d935a89 commit 10c3dd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/widgets/kernel/qgesturemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
QWidget *child = topLevel->childAt(topLevel->mapFromGlobal(pt));
target = child ? child : topLevel;
}
} else {
}
if (!target) {
// or use the context of the gesture
QObject *context = m_gestureOwners.value(gesture, 0);
if (context->isWidgetType())
Expand Down

0 comments on commit 10c3dd8

Please sign in to comment.