diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 1f9183d..ef391e4 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include QT_BEGIN_NAMESPACE @@ -114,6 +115,7 @@ QSurfaceFormat QPlatformWindow::format() const */ void QPlatformWindow::setGeometry(const QRect &rect) { + qDebug() << "QPlatformWindow::setGeometry" << window() << rect; Q_D(QPlatformWindow); d->rect = rect; } diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 13218fa..ac0b862 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -474,6 +474,7 @@ void QWindow::create() Q_D(QWindow); if (!d->platformWindow) { d->platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(this); + qDebug() <<">QWindow::create" << this << geometry(); QObjectList childObjects = children(); for (int i = 0; i < childObjects.size(); i ++) { QObject *object = childObjects.at(i); @@ -484,6 +485,7 @@ void QWindow::create() } } } + qDebug() <<"positionAutomatic; d->positionAutomatic = false; if (rect == geometry()) return; @@ -1412,6 +1417,7 @@ void QWindow::setFramePosition(const QPoint &point) */ void QWindow::setPosition(const QPoint &pt) { + qDebug() << "QWindow::setPosition" << this << " at " << position()<< "to" << pt; setGeometry(QRect(pt, size())); } @@ -1457,6 +1463,7 @@ void QWindow::resize(int w, int h) */ void QWindow::resize(const QSize &newSize) { + qDebug() << "QWindow::resize" << this << " at " << position()<< "to" << newSize; Q_D(QWindow); if (d->platformWindow) { d->platformWindow->setGeometry(QRect(position(), newSize)); diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index af352e4..68024a4 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -703,6 +703,7 @@ void QDialog::setVisible(bool visible) if (!testAttribute(Qt::WA_Moved)) { Qt::WindowStates state = windowState(); + qDebug() << "Calling adjustPosition from " << __FUNCTION__; adjustPosition(parentWidget()); setAttribute(Qt::WA_Moved, false); // not really an explicit position if (state != windowState()) @@ -779,7 +780,9 @@ void QDialog::showEvent(QShowEvent *event) { if (!event->spontaneous() && !testAttribute(Qt::WA_Moved)) { Qt::WindowStates state = windowState(); + qDebug() << "Calling adjustPosition from " << __FUNCTION__; adjustPosition(parentWidget()); + qDebug() << __FUNCTION__ << "cleared move"; setAttribute(Qt::WA_Moved, false); // not really an explicit position if (state != windowState()) setWindowState(state); @@ -789,6 +792,7 @@ void QDialog::showEvent(QShowEvent *event) /*! \internal */ void QDialog::adjustPosition(QWidget* w) { + qDebug() << __FUNCTION__ << ">"<< this; if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) if (theme->themeHint(QPlatformTheme::WindowAutoPlacement).toBool()) @@ -857,6 +861,7 @@ void QDialog::adjustPosition(QWidget* w) p.setY(desk.y()); move(p); + qDebug() << __FUNCTION__ << "fixPosIncludesFrame(); d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false); diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index ae8a0b2..c82fe7c 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -111,10 +111,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO win->setFlags(data.window_flags); fixPosIncludesFrame(); if (q->testAttribute(Qt::WA_Moved) - || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)) + || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)) { + qDebug() << __FUNCTION__ << q << "SETGEOM" <geometry(); win->setGeometry(q->geometry()); - else + } else { + qDebug() << __FUNCTION__ << q << "RESIZING"<< q->geometry(); win->resize(q->size()); + } win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0)); if (q->testAttribute(Qt::WA_TranslucentBackground)) { @@ -532,10 +535,13 @@ void QWidgetPrivate::show_sys() const QRect windowRect = window->geometry(); if (windowRect != geomRect) { if (q->testAttribute(Qt::WA_Moved) - || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)) + || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement)) { + qDebug() << __FUNCTION__ << q << "setGeometry"; window->setGeometry(geomRect); - else + } else { + qDebug() << __FUNCTION__ << q << "Calling resize"; window->resize(geomRect.size()); + } } if (QBackingStore *store = q->backingStore()) { @@ -681,7 +687,10 @@ void QWidgetPrivate::stackUnder_sys(QWidget*) void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) { + Q_Q(QWidget); + if (q->isWindow()) + qDebug() <<">QWidgetPrivate::setGeometry_sys" << q << x << y << w << h <maxw); h = qMin(h,extra->maxh); @@ -705,12 +714,17 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) bool isResize = olds != r.size(); isMove = oldp != r.topLeft(); //### why do we have isMove as a parameter? + if (q->isWindow()) + qDebug() <<"QWidgetPrivate::setGeometry_sys mov" << isMove << "resize"<isWindow()) + qDebug() <<"data->window_state &= ~Qt::WindowMaximized; @@ -738,9 +752,11 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (!q->testAttribute(Qt::WA_DontShowOnScreen) && !q->testAttribute(Qt::WA_OutsideWSRange)) { if (q->windowHandle()) { if (q->isWindow()) { + qDebug() << __FUNCTION__ << q << '1' << q->geometry(); q->windowHandle()->setGeometry(q->geometry()); } else { QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint()); + qDebug() << __FUNCTION__ << q << '2' << QRect(posInNativeParent,r.size()); q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size())); } const QWidgetBackingStore *bs = maybeBackingStore(); @@ -778,6 +794,9 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) q->setAttribute(Qt::WA_PendingResizeEvent, true); } + if (q->isWindow()) + qDebug() <<"