diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-07 17:10:56 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-07 17:10:57 +0200 |
commit | fc5da399c3145621c5945d53dde7b37fa463c6e9 (patch) | |
tree | 8deec4c78b5add097ba7f2b1e371f27e3ae759c5 /src/plugins/platforms | |
parent | 225dcf355a95f272aaa7ac236c7274e254dca41c (diff) | |
parent | a14a943f9ac3d1e85514d7fb6688c84e624ac850 (diff) |
Merge 5.11 into 5.11.1
Change-Id: I28f48e980a9e23ddde5251608dd9d1d83df65392
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsnativeinterface.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp index 324b00144e..ffa100f824 100644 --- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp +++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp @@ -278,6 +278,8 @@ QFunctionPointer QWindowsNativeInterface::platformFunction(const QByteArray &fun return QFunctionPointer(QWindowsWindow::setTouchWindowTouchTypeStatic); else if (function == QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()) return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenStatic); + else if (function == QWindowsWindowFunctions::setWindowActivationBehaviorIdentifier()) + return QFunctionPointer(QWindowsNativeInterface::setWindowActivationBehavior); else if (function == QWindowsWindowFunctions::isTabletModeIdentifier()) return QFunctionPointer(QWindowsNativeInterface::isTabletMode); return nullptr; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index a2883e2601..3909c64c53 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2201,6 +2201,15 @@ void QWindowsWindow::requestActivateWindow() foregroundThread = GetWindowThreadProcessId(foregroundWindow, NULL); if (foregroundThread && foregroundThread != currentThread) attached = AttachThreadInput(foregroundThread, currentThread, TRUE) == TRUE; + if (attached) { + if (!window()->flags().testFlag(Qt::WindowStaysOnBottomHint) + && !window()->flags().testFlag(Qt::WindowStaysOnTopHint) + && window()->type() != Qt::ToolTip) { + const UINT swpFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER; + SetWindowPos(m_data.hwnd, HWND_TOPMOST, 0, 0, 0, 0, swpFlags); + SetWindowPos(m_data.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, swpFlags); + } + } } } SetForegroundWindow(m_data.hwnd); |