Windows: Let topmost and bottom windows use raise and lower respectively

329a029c36 made ::raise and ::lower do nothing
for topmost and bottommost windows. This made it impossible to
e.g. raise one topmost window above another topmost window using
QWindow::raise.

Task-number: QTBUG-62021
Change-Id: I5f60816cbc48d69c0411e3bd68852d8bd8e300bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Mårten Nordheim 2017-10-03 10:25:22 +02:00
parent f62768d046
commit 7f7d939380

View File

@ -875,7 +875,7 @@ void QWindowsBaseWindow::raise_sys()
const Qt::WindowType type = window()->type();
if (type == Qt::Popup
|| type == Qt::SubWindow // Special case for QTBUG-63121: MDI subwindows with WindowStaysOnTopHint
|| (window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0) {
|| !(window()->flags() & Qt::WindowStaysOnBottomHint)) {
SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
}
@ -883,7 +883,7 @@ void QWindowsBaseWindow::raise_sys()
void QWindowsBaseWindow::lower_sys()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0)
if (!(window()->flags() & Qt::WindowStaysOnTopHint))
SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}