From 66be5445e64b54bf60069dfee5dd918459e3deed Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 1 Aug 2018 12:59:42 +0200 Subject: Windows: Implement Qt::WindowStaysOnBottomHint Set the Z-order to HWND_BOTTOM in that case. Add a doc note stating that it only works for frameless or full screen windows. Task-number: QTBUG-53717 Change-Id: I7abf219a88aac715c51d27d925504da9e91b56f1 Reviewed-by: Paul Wicking Reviewed-by: Andre de la Rocha Reviewed-by: Oliver Wolff --- src/corelib/global/qnamespace.qdoc | 8 ++++++-- src/plugins/platforms/windows/qwindowswindow.cpp | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 36f2aaee72..8e46f3f0fd 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2271,13 +2271,17 @@ correctly. \value WindowStaysOnBottomHint Informs the window system that the - window should stay on bottom of all other windows. Note - that on X11 this hint will work only in window managers + window should stay on bottom of all other windows. + + \note On X11, this hint will work only in window managers that support _NET_WM_STATE_BELOW atom. If a window always on the bottom has a parent, the parent will also be left on the bottom. This window hint is currently not implemented for \macos. + \note On Windows, this will work only for frameless or + full-screen windows. + \value WindowTransparentForInput Informs the window system that this window is used only for output (displaying something) and does not take input. Therefore input events should pass through as if it wasn't there. diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index aa40d422fb..ca87f1b6a4 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2081,6 +2081,8 @@ bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow * HWND desktopHWND = GetDesktopWindow(); platformWindow->m_data.embedded = !parentWindow && parentHWND && (parentHWND != desktopHWND); } + if (qWindow->flags().testFlag(Qt::WindowStaysOnBottomHint)) + windowPos->hwndInsertAfter = HWND_BOTTOM; } if (!qWindow->isTopLevel()) // Implement hasHeightForWidth(). return false; -- cgit v1.2.3