Make sure QWidgetPrivate::hide_sys() really hides

When commit 55fa3c189f 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>
bb10
Bradley T. Hughes 2012-05-04 14:55:49 +02:00 committed by Qt by Nokia
parent cebfd69ade
commit 9f2f7a8f72
1 changed files with 9 additions and 11 deletions

View File

@ -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()