From c592b71d266a8f7a9bbf330fb3cbca168dbe1bfc Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 16 Nov 2010 11:24:53 +0100 Subject: Use WS_POPUP window style more often on windows. We dont use the WS_POPUP style when one of the following window flags are set (WindowSystemMenuHint, WindowTitleHint, WindowMinMaxButtonsHint WindowCloseButtonHint, WindowContextHelpButtonHint). None of these flags can conflict with this style, hence being removed. Task-number: QTBUG-10589 Reviewed-by: Denis --- src/gui/kernel/qwidget_win.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 39ed750..c358b9b 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -329,18 +329,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (topLevel) { if ((type == Qt::Window || dialog || tool)) { if (!(flags & Qt::FramelessWindowHint)) { - if (!(flags & Qt::MSWindowsFixedSizeDialogHint)) { + style |= WS_POPUP; + if (!(flags & Qt::MSWindowsFixedSizeDialogHint)) style |= WS_THICKFRAME; - if(!(flags & - ( Qt::WindowSystemMenuHint - | Qt::WindowTitleHint - | Qt::WindowMinMaxButtonsHint - | Qt::WindowCloseButtonHint - | Qt::WindowContextHelpButtonHint))) - style |= WS_POPUP; - } else { - style |= WS_POPUP | WS_DLGFRAME; - } + else + style |= WS_DLGFRAME; } if (flags & Qt::WindowTitleHint) style |= WS_CAPTION; @@ -424,6 +417,14 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (!q->testAttribute(Qt::WA_Resized)) { w = sw/2; h = 4*sh/10; + if (extra) { + int dx = rect.right - rect.left; + int dy = rect.bottom - rect.top; + w = qMin(w, extra->maxw + dx); + h = qMin(h, extra->maxh + dy); + w = qMax(w, extra->minw + dx); + h = qMax(h, extra->minh + dy); + } } if (!wasMoved) { x = sw/2 - w/2; -- cgit v0.12