From 11f867c34af4fafaf987dfa1a843ecd23d2e8da6 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 30 Aug 2011 15:00:38 +0200 Subject: [PATCH] pick up the target window for a mouse event when none is specified Change-Id: Iae0402f63f39a2728b94abe68fa22592d97ea9f3 Reviewed-on: http://codereview.qt.nokia.com/3885 Reviewed-by: Qt Sanity Bot Reviewed-by: Laszlo Agocs --- src/gui/kernel/qguiapplication.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 7ab098e..d5e08e1 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -546,9 +546,6 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e) { - if (!e->window) - return; - QEvent::Type type; // move first Qt::MouseButtons stateChange = e->buttons ^ buttons; @@ -561,6 +558,9 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo QWindow *window = e->window.data(); + if (!window) + window = QGuiApplication::topLevelAt(e->globalPos.toPoint()); + QPointF localPoint = e->localPos; QPointF globalPoint = e->globalPos; -- 2.7.4