From 9f2f7a8f7270411677f2074fdf635f8b4b94d325 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 4 May 2012 14:55:49 +0200 Subject: 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 Reviewed-by: Sean Harmer Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidget_qpa.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src') 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() -- cgit v1.2.3