diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6afa4e6591..b19510073a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -540,13 +540,9 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag } if (flags & Qt::WindowSystemMenuHint) style |= WS_SYSMENU; - else if (dialog) { - // QTBUG-2027, dialogs without system menu. - style |= WS_SYSMENU; - if (!(flags & Qt::FramelessWindowHint)) { - style |= WS_BORDER; - exStyle |= WS_EX_DLGMODALFRAME; - } + else if (dialog && (flags & Qt::WindowCloseButtonHint) && !(flags & Qt::FramelessWindowHint)) { + style |= WS_SYSMENU | WS_BORDER; // QTBUG-2027, dialogs without system menu. + exStyle |= WS_EX_DLGMODALFRAME; } if (flags & Qt::WindowMinimizeButtonHint) style |= WS_MINIMIZEBOX;