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:
parent
e361a3f178
commit
6292c51306
@ -43,21 +43,24 @@
|
|||||||
#include "qkmsscreen.h"
|
#include "qkmsscreen.h"
|
||||||
|
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
#include <qpa/qwindowsysteminterface.h>
|
||||||
|
#include <qpa/qplatformwindow_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QKmsWindow::QKmsWindow(QWindow *window)
|
QKmsWindow::QKmsWindow(QWindow *window)
|
||||||
: QPlatformWindow(window)
|
: QPlatformWindow(window)
|
||||||
{
|
{
|
||||||
|
Q_D(QPlatformWindow);
|
||||||
m_screen = QPlatformScreen::platformScreenForWindow(window);
|
m_screen = QPlatformScreen::platformScreenForWindow(window);
|
||||||
|
|
||||||
static_cast<QKmsScreen *>(m_screen)->initializeWithFormat(window->requestedFormat());
|
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)
|
void QKmsWindow::setGeometry(const QRect &rect)
|
||||||
{
|
{
|
||||||
Q_UNUSED(rect)
|
// All windows must be fullscreen
|
||||||
//All Windows must be fullscreen
|
|
||||||
QRect fullscreenRect = m_screen->availableGeometry();
|
QRect fullscreenRect = m_screen->availableGeometry();
|
||||||
|
if (rect != fullscreenRect)
|
||||||
QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect);
|
QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect);
|
||||||
|
|
||||||
QPlatformWindow::setGeometry(fullscreenRect);
|
QPlatformWindow::setGeometry(fullscreenRect);
|
||||||
|
@ -48,6 +48,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QKmsWindow : public QPlatformWindow
|
class QKmsWindow : public QPlatformWindow
|
||||||
{
|
{
|
||||||
|
Q_DECLARE_PRIVATE(QPlatformWindow)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QKmsWindow(QWindow *window);
|
QKmsWindow(QWindow *window);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user