diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index fd89e479b8..bb301bfa6c 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -213,6 +213,7 @@ QWindow::QWindow(QWindowPrivate &dd, QWindow *parent)
 */
 QWindow::~QWindow()
 {
+    qDebug() << __FUNCTION__ << this;
     Q_D(QWindow);
     d->destroy();
     QGuiApplicationPrivate::window_list.removeAll(this);
@@ -228,6 +229,7 @@ QWindow::~QWindow()
 
 void QWindowPrivate::init(QScreen *targetScreen)
 {
+    qDebug() << __FUNCTION__ << this;
     Q_Q(QWindow);
 
     parentWindow = static_cast<QWindow *>(q->QObject::parent());
@@ -514,6 +516,7 @@ void QWindowPrivate::create(bool recursive, WId nativeHandle)
     Q_Q(QWindow);
     if (platformWindow)
         return;
+    qDebug() << __FUNCTION__ << this;
 
     // avoid losing update requests when re-creating
     const bool needsUpdate = updateRequestPending;
@@ -1730,6 +1733,7 @@ void QWindow::setGeometry(const QRect &rect)
         return;
 
     d->positionPolicy = QWindowPrivate::WindowFrameExclusive;
+    qDebug() << __FUNCTION__ << this << d->positionPolicy << rect;
     if (d->platformWindow) {
         QRect nativeRect;
         QScreen *newScreen = d->screenForGeometry(rect);
@@ -1947,6 +1951,7 @@ void QWindow::destroy()
     Q_D(QWindow);
     if (!d->platformWindow)
         return;
+    qDebug() << __FUNCTION__ << this;
 
     if (d->platformWindow->isForeignWindow())
         return;
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index d2c22f4100..d493848e93 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1871,6 +1871,8 @@ void QWindowsWindow::setGeometry(const QRect &rectIn)
     QRect rect = rectIn;
     // This means it is a call from QWindow::setFramePosition() and
     // the coordinates include the frame (size is still the contents rectangle).
+    auto b = QWindowsGeometryHint::positionIncludesFrame(window());
+    qDebug() << __FUNCTION__ << window() << "positionIncludesFrame=" << b << rectIn;
     if (QWindowsGeometryHint::positionIncludesFrame(window())) {
         const QMargins margins = frameMargins();
         rect.moveTopLeft(rect.topLeft() + QPoint(margins.left(), margins.top()));
@@ -1994,7 +1996,7 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
     const QMargins margins = fullFrameMargins();
     const QRect frameGeometry = rect + margins;
 
-    qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << window()
+    qDebug() << '>' << __FUNCTION__ << window()
         << "\n from " << geometry_sys() << " frame: "
         << margins << " to " <<rect
         << " new frame: " << frameGeometry;
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 906022a185..ee78c7b75f 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -908,6 +908,7 @@ void QDialog::adjustPosition(QWidget* w)
             extrah = qMax(extrah, frameh);
         }
     }
+    qDebug() << __FUNCTION__ << this << "extra" << extraw << extrah;
 
     // sanity check for decoration frames. With embedding, we
     // might get extraordinary values
@@ -929,9 +930,12 @@ void QDialog::adjustPosition(QWidget* w)
     } else {
         // p = middle of the desktop
         p = QPoint(desk.x() + desk.width()/2, desk.y() + desk.height()/2);
+        qDebug() << __FUNCTION__ << this <<"DSKT";
     }
+    qDebug() << __FUNCTION__ << this << p;
 
     // p = origin of this
+    qDebug() << __FUNCTION__ << this << size();
     p = QPoint(p.x()-width()/2 - extraw,
                 p.y()-height()/2 - extrah);
 
@@ -945,6 +949,7 @@ void QDialog::adjustPosition(QWidget* w)
         p.setY(desk.y() + desk.height() - height() - extrah);
     if (p.y() < desk.y())
         p.setY(desk.y());
+    qDebug() << __FUNCTION__ << this << "re-centered" << p;
 
     // QTBUG-52735: Manually set the correct target screen since scaling in a
     // subsequent call to QWindow::resize() may otherwise use the wrong factor
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 1eac50df81..85827958d7 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -100,6 +100,7 @@
 #include "private/qevent_p.h"
 
 #include "private/qgesturemanager_p.h"
+#include "qdebug.h"
 
 #ifdef QT_KEYPAD_NAVIGATION
 #if QT_CONFIG(tabwidget)
@@ -1692,6 +1693,7 @@ void QWidgetPrivate::deleteTLSysExtra()
         //delete the qglcontext before we delete the qplatformopenglcontext.
         //One unfortunate thing about this is that we potentially create a glContext just to
         //delete it straight afterwards.
+        qDebug() << __FUNCTION__ << q_func();
         if (extra->topextra->window) {
             extra->topextra->window->destroy();
         }
@@ -6934,6 +6936,7 @@ void QWidget::move(const QPoint &p)
     if (testAttribute(Qt::WA_WState_Created)) {
         if (isWindow())
             d->topData()->posIncludesFrame = false;
+        qDebug() << __FUNCTION__ << this << "WA_WState_Created" << p;
         d->setGeometry_sys(p.x() + geometry().x() - QWidget::x(),
                        p.y() + geometry().y() - QWidget::y(),
                        width(), height(), true);
@@ -6942,6 +6945,7 @@ void QWidget::move(const QPoint &p)
         // no frame yet: see also QWidgetPrivate::fixPosIncludesFrame(), QWindowPrivate::PositionPolicy.
         if (isWindow())
             d->topData()->posIncludesFrame = true;
+        qDebug() << __FUNCTION__ << this << "not Created" << p;
         data->crect.moveTopLeft(p); // no frame yet
         setAttribute(Qt::WA_PendingMoveEvent);
     }
@@ -7029,7 +7033,10 @@ void QWidget::setGeometry(const QRect &r)
 
 void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
 {
+
     Q_Q(QWidget);
+    if (q->isWindow())
+        qDebug() << __FUNCTION__ << q << x << y << w << h << "isMove=" << isMove;
     if (extra) {                                // any size restrictions?
         w = qMin(w,extra->maxw);
         h = qMin(h,extra->maxh);
@@ -8273,12 +8280,16 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
 
 
     if (!that.isNull()) {
+        qDebug() << __FUNCTION__ << "close branch";
+        data.fstrut_dirty = 1;
         data.is_closing = 0;
+
         if (q->testAttribute(Qt::WA_DeleteOnClose)) {
             q->setAttribute(Qt::WA_DeleteOnClose, false);
             q->deleteLater();
         }
     }
+    qDebug() << __FUNCTION__ << that.data();
     return true;
 }
 
@@ -11736,10 +11747,15 @@ QRect QWidgetPrivate::frameStrut() const
 void QWidgetPrivate::updateFrameStrut()
 {
     Q_Q(QWidget);
+    if (q->isWindow())
+        qDebug() << __FUNCTION__ << q << "dirty" << q->data->fstrut_dirty;
     if (q->data->fstrut_dirty) {
         if (QTLWExtra *te = maybeTopData()) {
+            qDebug() << __FUNCTION__ << "1";
             if (te->window && te->window->handle()) {
+                qDebug() << __FUNCTION__ << "2";
                 const QMargins margins = te->window->frameMargins();
+                qDebug() << __FUNCTION__ << q << margins;
                 if (!margins.isNull()) {
                     te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
                     q->data->fstrut_dirty = false;
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 51e484202d..2edc8c5437 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -733,6 +733,7 @@ bool QWidgetWindow::updateSize()
         m_widget->data->crect.setSize(geometry().size());
     }
 
+    qDebug() << __FUNCTION__ << "um!";
     updateMargins();
     return changed;
 }
@@ -743,6 +744,11 @@ void QWidgetWindow::updateMargins()
     QTLWExtra *te = m_widget->d_func()->topData();
     te->posIncludesFrame= false;
     te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+    auto w = te->window;
+    auto p = w ? w->handle() : nullptr;
+    qDebug() << __FUNCTION__ <<  m_widget.data() << margins
+             << "is_closing" << m_widget->data->is_closing
+             << w << p;
     m_widget->data->fstrut_dirty = false;
 }
 
@@ -813,6 +819,7 @@ void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
     if (changed)
         m_widget->data->crect.moveTopLeft(newPosition);
 
+    qDebug() << __FUNCTION__ << "um!" << changed;
     updateMargins(); // FIXME: Only do when changed?
 
     if (changed) {
@@ -825,6 +832,7 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
 {
     auto oldRect = m_widget->rect();
 
+    qDebug() << __FUNCTION__ << m_widget << oldRect << event->size();
     if (updateSize()) {
         QGuiApplication::forwardEvent(m_widget, event);
 
