summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qplatformintegration.h3
-rw-r--r--src/gui/kernel/qplatformscreen.cpp11
2 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index d9f349555a..01406958e2 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -106,7 +106,8 @@ public:
ApplicationIcon,
SwitchableWidgetComposition,
TopStackedNativeChildWindows,
- OpenGLOnRasterSurface
+ OpenGLOnRasterSurface,
+ MaximizeUsingFullscreenGeometry
};
virtual ~QPlatformIntegration() { }
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index f3213bf5ea..7daf48b191 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -410,15 +410,22 @@ void QPlatformScreen::resizeMaximizedWindows()
const QRect newGeometry = deviceIndependentGeometry();
const QRect newAvailableGeometry = QHighDpi::fromNative(availableGeometry(), QHighDpiScaling::factor(this), newGeometry.topLeft());
+ const bool supportsMaximizeUsingFullscreen = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MaximizeUsingFullscreenGeometry);
+
for (QWindow *w : windows()) {
// Skip non-platform windows, e.g., offscreen windows.
if (!w->handle())
continue;
- if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry)
+ if (supportsMaximizeUsingFullscreen
+ && w->windowState() & Qt::WindowMaximized
+ && w->flags() & Qt::MaximizeUsingFullscreenGeometryHint) {
+ w->setGeometry(newGeometry);
+ } else if (w->windowState() & Qt::WindowMaximized || w->geometry() == oldAvailableGeometry) {
w->setGeometry(newAvailableGeometry);
- else if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry)
+ } else if (w->windowState() & Qt::WindowFullScreen || w->geometry() == oldGeometry) {
w->setGeometry(newGeometry);
+ }
}
}