summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-10-30 10:21:36 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-30 12:53:46 +0100
commita48508cd766b056d3cb5b6502cf269a8293bb5a5 (patch)
tree1e9d0fcd89c7a0f07cfe00379f10d3ede4852596 /src/gui/kernel/qwindow.cpp
parent50ec06da2c8a1c680d48b84f8c1267fe78a86b6a (diff)
Send leave to most recently entered window when modal dialog is shown.
If a modal dialog was shown as a response to button click, the button retained its hover highlight, because it didn't get leave event. Fixed by tracking the most recently entered window and sending a leave to it when modal dialog is shown that blocks it. Also modified tst_QGuiApplication::modalWindow() autotest to check for enters and leaves. Task-number: QTBUG-27644 Change-Id: I387647e18a762a39d523e3df31221b9583a39f9d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 4f1610cb21..a17270912f 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -214,6 +214,8 @@ QWindow::~QWindow()
{
if (QGuiApplicationPrivate::focus_window == this)
QGuiApplicationPrivate::focus_window = 0;
+ if (QGuiApplicationPrivate::currentMouseWindow == this)
+ QGuiApplicationPrivate::currentMouseWindow = 0;
QGuiApplicationPrivate::window_list.removeAll(this);
destroy();
}
@@ -1445,6 +1447,8 @@ bool QWindow::close()
if (QGuiApplicationPrivate::focus_window == this)
QGuiApplicationPrivate::focus_window = 0;
+ if (QGuiApplicationPrivate::currentMouseWindow == this)
+ QGuiApplicationPrivate::currentMouseWindow = 0;
QGuiApplicationPrivate::window_list.removeAll(this);
destroy();