diff options
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsglcontext.cpp | 14 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 29 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 3 |
4 files changed, 40 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index d63149e4ce..281f54a9d9 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -586,15 +586,17 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB; attributes[attribIndex++] = minorVersion; } + + int flags = 0; + if (format.testOption(QSurfaceFormat::DebugContext)) + flags |= WGL_CONTEXT_DEBUG_BIT_ARB; if (requestedVersion >= 0x0300) { - attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; - attributes[attribIndex] = 0; if (!format.testOption(QSurfaceFormat::DeprecatedFunctions)) - attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - if (format.testOption(QSurfaceFormat::DebugContext)) - attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB; - attribIndex++; + flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; } + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = flags; + if (requestedVersion >= 0x0302) { switch (format.profile()) { case QSurfaceFormat::NoProfile: diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index eb1bbd1ab0..00a5da8f44 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -383,6 +383,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const } case DialogSnapToDefaultButton: return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false)); + case ContextMenuOnMouseRelease: + return QVariant(true); default: break; } diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 006a2802c1..d1d50eee73 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1170,8 +1170,13 @@ void QWindowsWindow::show_sys() const if (type == Qt::Popup || type == Qt::ToolTip || type == Qt::Tool) sm = SW_SHOWNOACTIVATE; + if (w->windowState() & Qt::WindowMaximized) + setFlag(WithinMaximize); // QTBUG-8361 + ShowWindow(m_data.hwnd, sm); + clearFlag(WithinMaximize); + if (fakedMaximize) { setStyle(style() & ~WS_MAXIMIZEBOX); SetWindowPos(m_data.hwnd, 0, 0, 0, 0, 0, @@ -1582,8 +1587,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) setFlag(FrameDirty); if ((oldState == Qt::WindowMaximized) != (newState == Qt::WindowMaximized)) { - if (visible && !(newState == Qt::WindowMinimized)) + if (visible && !(newState == Qt::WindowMinimized)) { + setFlag(WithinMaximize); ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE); + clearFlag(WithinMaximize); + } } if ((oldState == Qt::WindowFullScreen) != (newState == Qt::WindowFullScreen)) { @@ -1903,6 +1911,25 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const { const QWindowsGeometryHint hint(window(), m_data.customMargins); hint.applyToMinMaxInfo(m_data.hwnd, mmi); + + if ((testFlag(WithinMaximize) || (window()->windowState() == Qt::WindowMinimized)) + && (m_data.flags & Qt::FramelessWindowHint)) { + // This block fixes QTBUG-8361: Frameless windows shouldn't cover the + // taskbar when maximized + if (const QScreen *screen = effectiveScreen(window())) { + mmi->ptMaxSize.y = screen->availableGeometry().height(); + + // Width, because you can have the taskbar on the sides too. + mmi->ptMaxSize.x = screen->availableGeometry().width(); + + // If you have the taskbar on top, or on the left you don't want it at (0,0): + mmi->ptMaxPosition.x = screen->availableGeometry().x(); + mmi->ptMaxPosition.y = screen->availableGeometry().y(); + } else { + qWarning() << "Invalid screen"; + } + } + if (QWindowsContext::verboseWindows) qDebug() << __FUNCTION__ << window() << *mmi; } diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index f055864482..61dc3e2dc2 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -136,7 +136,8 @@ public: TouchRegistered = 0x4000, AlertState = 0x8000, Exposed = 0x10000, - WithinCreate = 0x20000 + WithinCreate = 0x20000, + WithinMaximize = 0x40000 }; struct WindowData |