From 6292c5130658af66b55b91c55e8458a3a2f4060f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 2 Aug 2012 11:08:16 +0300 Subject: [PATCH] Properly manage window geometry in kms If QWindow::setGeometry() is called before QWindow::create(), QKmsWindow::setGeometry() is not called at all. This is wrong because there is some special size restricting happening there which must never be skipped. Change-Id: I321632d4fdb327b0a75e6791c019b3f4c2793888 Reviewed-by: Elvis Lee Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/kms/qkmswindow.cpp | 11 +++++++---- src/plugins/platforms/kms/qkmswindow.h | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/kms/qkmswindow.cpp b/src/plugins/platforms/kms/qkmswindow.cpp index 691d9a832c1..f016d9d6214 100644 --- a/src/plugins/platforms/kms/qkmswindow.cpp +++ b/src/plugins/platforms/kms/qkmswindow.cpp @@ -43,22 +43,25 @@ #include "qkmsscreen.h" #include +#include + QT_BEGIN_NAMESPACE QKmsWindow::QKmsWindow(QWindow *window) : QPlatformWindow(window) { + Q_D(QPlatformWindow); m_screen = QPlatformScreen::platformScreenForWindow(window); - static_cast(m_screen)->initializeWithFormat(window->requestedFormat()); + setGeometry(d->rect); // rect is set to window->geometry() in base ctor } void QKmsWindow::setGeometry(const QRect &rect) { - Q_UNUSED(rect) - //All Windows must be fullscreen + // All windows must be fullscreen QRect fullscreenRect = m_screen->availableGeometry(); - QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect); + if (rect != fullscreenRect) + QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect); QPlatformWindow::setGeometry(fullscreenRect); } diff --git a/src/plugins/platforms/kms/qkmswindow.h b/src/plugins/platforms/kms/qkmswindow.h index c9b3c2692fa..ba76b2beac8 100644 --- a/src/plugins/platforms/kms/qkmswindow.h +++ b/src/plugins/platforms/kms/qkmswindow.h @@ -48,6 +48,8 @@ QT_BEGIN_NAMESPACE class QKmsWindow : public QPlatformWindow { + Q_DECLARE_PRIVATE(QPlatformWindow) + public: QKmsWindow(QWindow *window);