diff options
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index dd9b9de0b6..8a80729354 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1149,6 +1149,13 @@ void QWindowsWindow::updateTransientParent() const #endif // !Q_OS_WINCE } +static inline bool testShowWithoutActivating(const QWindow *window) +{ + // QWidget-attribute Qt::WA_ShowWithoutActivating . + const QVariant showWithoutActivating = window->property("_q_showWithoutActivating"); + return showWithoutActivating.isValid() && showWithoutActivating.toBool(); +} + // partially from QWidgetPrivate::show_sys() void QWindowsWindow::show_sys() const { @@ -1180,7 +1187,7 @@ void QWindowsWindow::show_sys() const } // Qt::WindowMaximized } // !Qt::WindowMinimized } - if (type == Qt::Popup || type == Qt::ToolTip || type == Qt::Tool) + if (type == Qt::Popup || type == Qt::ToolTip || type == Qt::Tool || testShowWithoutActivating(w)) sm = SW_SHOWNOACTIVATE; if (w->windowState() & Qt::WindowMaximized) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 2d12674c29..455d195159 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1403,10 +1403,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO win->setProperty(propertyName, q->property(propertyName)); } -#ifdef Q_OS_OSX if (q->testAttribute(Qt::WA_ShowWithoutActivating)) win->setProperty("_q_showWithoutActivating", QVariant(true)); -#endif win->setFlags(data.window_flags); fixPosIncludesFrame(); if (q->testAttribute(Qt::WA_Moved) |