From 143350c8767a54469721e5489f5d62a3ab34e264 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 4 Mar 2015 14:33:37 +0300 Subject: Always clear QWindowPrivate::positionAutomatic in setFramePosition() Change-Id: I3dd494eee6a133c05256cc1518853e6c5511f8b7 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/kernel/qwindow.cpp') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index a4b5376b6f..ad17621f9d 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1500,10 +1500,10 @@ void QWindow::setFramePosition(const QPoint &point) { Q_D(QWindow); d->positionPolicy = QWindowPrivate::WindowFrameInclusive; + d->positionAutomatic = false; if (d->platformWindow) { d->platformWindow->setGeometry(QRect(point, size())); } else { - d->positionAutomatic = false; d->geometry.moveTopLeft(point); } } -- cgit v1.2.3 From 7baaec17edb06634f1d6235a55c7adbd112cba3e Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 26 Feb 2015 16:16:56 +0300 Subject: Fix use of the window geometry specification Until now we applied the geometry in QWidget::setVisible() by calling QWidget::move() and QWidget::resize(). But these methods are unreliable when the window is created but not visible yet. For example, specifying the window position by "-geometry +0+0" will take no effect. Apply the geometry directly to QWindow in QWindow::setVisible(). QWidget will update its geometry after the response of the window system. Besides it allows to specify the geometry for QML applications. Task-number: QTBUG-44713 Change-Id: I9a0e110e81e569c81da802729707fec104fef887 Reviewed-by: Friedemann Kleint Reviewed-by: Shawn Rutledge --- src/gui/kernel/qwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gui/kernel/qwindow.cpp') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index ad17621f9d..6561e0f502 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -487,6 +487,13 @@ void QWindow::setVisible(bool visible) } if (!app_priv->forcedWindowIcon.isNull()) setIcon(app_priv->forcedWindowIcon); + + // Handling of the -qwindowgeometry, -geometry command line arguments + static bool geometryApplied = false; + if (!geometryApplied) { + geometryApplied = true; + QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(this); + } } QShowEvent showEvent; -- cgit v1.2.3