summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-10-28 14:11:50 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-20 09:39:56 +0100
commit829b1d13b225e87b8a385397e2b53c7a9f8cda9e (patch)
tree50d536be8782ae02c70c0dd72ea81dc361cf2881 /src
parent558b0a24d6a7b9a12fd5e970be2a6743eae2cafc (diff)
Ensure Qt::WA_Mapped is set in case of obscured native windows.
Task-number: QTBUG-33520 Change-Id: I51f9b4634be29fd32f4ad9cc8b5d3e10b19ea2f5 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index ae8a0b25b9..18045e3b09 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -506,9 +506,9 @@ void QWidgetPrivate::show_sys()
QWindow *window = q->windowHandle();
+ q->setAttribute(Qt::WA_Mapped);
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
invalidateBuffer(q->rect());
- q->setAttribute(Qt::WA_Mapped);
if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
// add our window to the modal window list
QGuiApplicationPrivate::showModalWindow(window);
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index e977ab3d6f..22e15e23fe 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -713,6 +713,10 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
break;
}
+ // Note that widgetState == m_widget->data->window_state when triggered by QWidget::setWindowState().
+ if (!(widgetState & Qt::WindowMinimized))
+ m_widget->setAttribute(Qt::WA_Mapped);
+
// Sent event if the state changed (that is, it is not triggered by
// QWidget::setWindowState(), which also sends an event to the widget).
if (widgetState != int(m_widget->data->window_state)) {