diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-15 09:12:37 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-15 20:31:28 +0000 |
commit | 329a029c361bcbaf70f3aa919693f0bef48a152f (patch) | |
tree | c35a160ed73ff5a793f50dbb2c67edc48199066b /src/plugins | |
parent | 791df9821d1ad05b7bf8a3849b90718dbdffbc5f (diff) |
Windows QPA: Do not raise/lower windows with Qt::WindowStaysOnTop/BottomHint
Prospectively helps to fix Qt::WindowStaysOnTopHint not working reliably
on Windows by preventing HWND_TOPMOST being cleared in raise().
Task-number: QTBUG-50271
Change-Id: I88f916a1cf8a2082236360b9eab874ad22b85762
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index d4effde52d..077511d4e1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -870,13 +870,15 @@ void QWindowsBaseWindow::hide_sys() // Normal hide, do not activate other window void QWindowsBaseWindow::raise_sys() { qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); - SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0) + SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } void QWindowsBaseWindow::lower_sys() { qCDebug(lcQpaWindows) << __FUNCTION__ << this << window(); - SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0) + SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } void QWindowsBaseWindow::setWindowTitle_sys(const QString &title) |