diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-05-04 14:55:49 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-09 13:41:54 +0200 |
commit | 9f2f7a8f7270411677f2074fdf635f8b4b94d325 (patch) | |
tree | e41c7bf3ff9dcb06c4e48c39f2866f46764f9d98 /src | |
parent | cebfd69ade5bf6f401d3d7b256e2073b0ac18183 (diff) |
Make sure QWidgetPrivate::hide_sys() really hides
When commit 55fa3c189f88933d390177ad5606d3de9deacf93 was merged from
api_changes, the conflict resolution left it possible for hide_sys() to
leave a visible window on screen. This happens when
Qt::WA_DontShowOnScreen is set on a visible widget. hide_sys() needs to
always hide the platform window if it is non-zero.
Change-Id: I3a1a882b66954e90d6ba80c657de69cae32e75a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 3666764e94..c4d1fb1d0d 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -521,12 +521,13 @@ void QWidgetPrivate::hide_sys() QWindow *window = q->windowHandle(); - if (q->testAttribute(Qt::WA_DontShowOnScreen) - && q->isWindow() - && q->windowModality() != Qt::NonModal - && window) { - // remove our window from the modal window list - QGuiApplicationPrivate::hideModalWindow(window); + if (q->testAttribute(Qt::WA_DontShowOnScreen)) { + q->setAttribute(Qt::WA_Mapped, false); + if (q->isWindow() && q->windowModality() != Qt::NonModal && window) { + // remove our window from the modal window list + QGuiApplicationPrivate::hideModalWindow(window); + } + // do not return here, if window non-zero, we must hide it } deactivateWidgetCleanup(); @@ -541,11 +542,8 @@ void QWidgetPrivate::hide_sys() invalidateBuffer(q->rect()); - if (q->testAttribute(Qt::WA_DontShowOnScreen)) { - q->setAttribute(Qt::WA_Mapped, false); - } else if (window) { - window->setVisible(false); - } + if (window) + window->setVisible(false); } void QWidgetPrivate::setMaxWindowState_helper() |