summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjian liang <jianliang79@gmail.com>2013-02-13 11:50:37 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-20 16:09:59 +0100
commitaf27b37b084d46bb7084633b56feaf3bb6a3ac48 (patch)
tree86add9562cf20948ee122201e0697e9134cb7b10 /src
parenta4c9ddb68fad7e970d6104689087eeabaeea2229 (diff)
Activate window before replay mouse press event
Activate the window of the widget under mouse pointer before replay mouse press event. Change-Id: I9e699374accf108aa49b2a3c73d5e76631100dfd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index d7b9d8c5fb..c543303024 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -356,6 +356,12 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
// the popup disappeared, replay the mouse press event
QWidget *w = QApplication::widgetAt(event->globalPos());
if (w && !QApplicationPrivate::isBlockedByModal(w)) {
+ // activate window of the widget under mouse pointer
+ if (!w->isActiveWindow()) {
+ w->activateWindow();
+ w->raise();
+ }
+
QWindow *win = w->windowHandle();
if (!win)
win = w->nativeParentWidget()->windowHandle();