From 71df75966db5f51c66bff1c436dd1cb5a895b51b Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 21 Aug 2015 18:03:46 +0100 Subject: Set positionAutomatic when using setX setY QWindow keeps track of whether a position has been explicitly set by use of a flag positionAutomatic which gets set in setGeometry. This is used to determine if position is passed to the window manager. However calls to setX, setY via properties did not update this flag if the caller is setting it to the default position 0,0. This patch fixes that by making sure the flag is always updated. Change-Id: I2c0c002fe57efa101b3ca79e6e8b3f36cc465761 Reviewed-by: Kai Uwe Broulik Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/kernel/qwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index b54e85a1d33..871437efb1b 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1270,8 +1270,11 @@ void QWindow::setMinimumSize(const QSize &size) */ void QWindow::setX(int arg) { + Q_D(QWindow); if (x() != arg) setGeometry(QRect(arg, y(), width(), height())); + else + d->positionAutomatic = false; } /*! @@ -1280,8 +1283,11 @@ void QWindow::setX(int arg) */ void QWindow::setY(int arg) { + Q_D(QWindow); if (y() != arg) setGeometry(QRect(x(), arg, width(), height())); + else + d->positionAutomatic = false; } /*! -- cgit v1.2.3