diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index b2eefbe5aaa..e55ffdc2290 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2345,6 +2345,8 @@ \value WindowDoesNotAcceptFocus Informs the window system that this window should not receive the input focus. + \note On Windows, this prevents the window from appearing in the taskbar. + \value MaximizeUsingFullscreenGeometryHint Deprecated alias for Qt::ExpandedClientAreaHint \value [since 6.9] ExpandedClientAreaHint Requests that the window's client area is diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 58514c96e1d..a91d2369475 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1217,6 +1217,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, case QtWindows::PointerEvent: return sessionManagerInteractionBlocked() || d->m_pointerHandler.translatePointerEvent(platformWindow->window(), hwnd, et, msg, result); case QtWindows::FocusInEvent: // see QWindowsWindow::requestActivateWindow(). + if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus) + return false; case QtWindows::FocusOutEvent: handleFocusEvent(et, platformWindow); return true; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index d7be8bbf4b1..78447ba9211 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -819,6 +819,9 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN ; + if (flags & Qt::WindowDoesNotAcceptFocus) + exStyle |= WS_EX_NOACTIVATE; + if (topLevel) { if ((type == Qt::Window || dialog || tool)) { if (!(flags & Qt::FramelessWindowHint)) {