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 <kwangwoong.lee@lge.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
This commit is contained in:
Laszlo Agocs 2012-08-02 11:08:16 +03:00 committed by Qt by Nokia
parent e361a3f178
commit 6292c51306
2 changed files with 9 additions and 4 deletions

View File

@ -43,22 +43,25 @@
#include "qkmsscreen.h"
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformwindow_p.h>
QT_BEGIN_NAMESPACE
QKmsWindow::QKmsWindow(QWindow *window)
: QPlatformWindow(window)
{
Q_D(QPlatformWindow);
m_screen = QPlatformScreen::platformScreenForWindow(window);
static_cast<QKmsScreen *>(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);
}

View File

@ -48,6 +48,8 @@ QT_BEGIN_NAMESPACE
class QKmsWindow : public QPlatformWindow
{
Q_DECLARE_PRIVATE(QPlatformWindow)
public:
QKmsWindow(QWindow *window);