diff options
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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); |