diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 06d2aa4fca2..dc775bcb61a 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -224,6 +224,11 @@ QPlatformServices *QPlatformIntegration::services() const fill the screen. The default implementation returns true. Returning false for this will cause all windows, including dialogs and popups, to be resized to fill the screen. + + \value WindowManagement The platform is based on a system that performs window + management. This includes the typical desktop platforms. Can be set to false on + platforms where no window management is available, meaning for example that windows + are never repositioned by the window manager. The default implementation returns true. */ @@ -241,7 +246,7 @@ QPlatformServices *QPlatformIntegration::services() const bool QPlatformIntegration::hasCapability(Capability cap) const { - return cap == NonFullScreenWindows || cap == NativeWidgets; + return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement; } QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index a98d332356b..0204181ca6c 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -93,7 +93,8 @@ public: ApplicationState, ForeignWindows, NonFullScreenWindows, - NativeWidgets + NativeWidgets, + WindowManagement }; virtual ~QPlatformIntegration() { } diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 12658e6d018..14b839c2dd5 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -134,6 +134,7 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons case ThreadedPixmaps: return true; case OpenGL: return true; case ThreadedOpenGL: return true; + case WindowManagement: return false; default: return QPlatformIntegration::hasCapability(cap); } } diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index a06283be021..ae8a0b25b9f 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -110,7 +110,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO win->setFlags(data.window_flags); fixPosIncludesFrame(); - if (q->testAttribute(Qt::WA_Moved)) + if (q->testAttribute(Qt::WA_Moved) + || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)) win->setGeometry(q->geometry()); else win->resize(q->size()); @@ -530,7 +531,8 @@ void QWidgetPrivate::show_sys() } const QRect windowRect = window->geometry(); if (windowRect != geomRect) { - if (q->testAttribute(Qt::WA_Moved)) + if (q->testAttribute(Qt::WA_Moved) + || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)) window->setGeometry(geomRect); else window->resize(geomRect.size());