diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 7b05ee5..8a38fc0 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2154,6 +2154,8 @@ void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePr
     bool isMove = oldRect.topLeft() != newRect.topLeft();
 
     window->d_func()->geometry = newRect;
+    qDebug() << __FUNCTION__ << window << newRect << "isMove=" <<  isMove
+             << "isResize=" <<isResize;
 
     if (isResize || window->d_func()->resizeEventPending) {
         QResizeEvent e(newRect.size(), oldRect.size());
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index cae9760..3a81848 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -141,8 +141,9 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
   If \a oldRect is null, Qt will use the previously reported geometry instead.
  */
 void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
-{
+{    
     QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw, QHighDpi::fromNativePixels(newRect, tlw), QHighDpi::fromNativePixels(oldRect, tlw));
+qDebug() << tlw << newRect;
     QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
 }
 
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index e4888d6..83883aa 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1391,6 +1391,7 @@ QRect QWindowsWindow::normalGeometry() const
 
 void QWindowsWindow::setGeometry(const QRect &rectIn)
 {
+    qDebug() << __FUNCTION__ << 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).
@@ -1769,11 +1770,14 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
             const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE;
             const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
             setFlag(SynchronousGeometryChangeEvent);
+qDebug() << __FUNCTION__ << "SetWindowPos" << r;
             SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf);
             if (!wasSync)
                 clearFlag(SynchronousGeometryChangeEvent);
+qDebug() << __FUNCTION__ << "notifying new geom" << window() << r;
             QWindowSystemInterface::handleGeometryChange(window(), r);
             QWindowSystemInterface::flushWindowSystemEvents();
+qDebug() << __FUNCTION__ << "notified new geom";
         } else if (newState != Qt::WindowMinimized) {
             // Restore saved state.
             unsigned newStyle = m_savedStyle ? m_savedStyle : style();
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 57148eb..63df4df 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7090,8 +7090,9 @@ void QWidget::move(const QPoint &p)
     } else {
         // no frame yet: see also QWidgetPrivate::fixPosIncludesFrame(), QWindowPrivate::PositionPolicy.
         if (isWindow())
-            d->topData()->posIncludesFrame = true;
+            d->topData()->posIncludesFrame = true;        
         data->crect.moveTopLeft(p); // no frame yet
+        qDebug() << __FUNCTION__ << this << "crect:=" << data->crect;
         setAttribute(Qt::WA_PendingMoveEvent);
     }
 
@@ -7140,6 +7141,7 @@ void QWidget::resize(const QSize &s)
         d->setDirtyOpaqueRegion();
     } else {
         data->crect.setSize(s.boundedTo(maximumSize()).expandedTo(minimumSize()));
+        qDebug() << __FUNCTION__ << this << "crect:=" << data->crect;
         setAttribute(Qt::WA_PendingResizeEvent);
     }
 }
@@ -7157,6 +7159,7 @@ void QWidget::setGeometry(const QRect &r)
     } else {
         data->crect.setTopLeft(r.topLeft());
         data->crect.setSize(r.size().boundedTo(maximumSize()).expandedTo(minimumSize()));
+        qDebug() << __FUNCTION__ << this << "crect:=" << data->crect;
         setAttribute(Qt::WA_PendingMoveEvent);
         setAttribute(Qt::WA_PendingResizeEvent);
     }
@@ -7207,6 +7210,9 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
 
     QPoint oldPos = q->pos();
     data.crect = r;
+    qDebug() << __FUNCTION__ << q << "crect:=" << r;
+    if (r.x() == 8)
+        qDebug("8");
 
     bool needsShow = false;
 
@@ -7216,6 +7222,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
             if (q->isVisible())
                 hide_sys();
             data.crect = QRect(x, y, w, h);
+            qDebug() << __FUNCTION__ << q << "crect:=" << data.crect;
         } else if (q->testAttribute(Qt::WA_OutsideWSRange)) {
             q->setAttribute(Qt::WA_OutsideWSRange, false);
             needsShow = true;
@@ -7947,6 +7954,8 @@ void QWidgetPrivate::show_sys()
             geomRect.moveTopLeft(topLeftOfWindow);
         }
         const QRect windowRect = window->geometry();
+qDebug() << __FUNCTION__ << q <<   "windowRect="      << windowRect << "geomRect="
+         << geomRect;
         if (windowRect != geomRect) {
             if (q->testAttribute(Qt::WA_Moved)
                 || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowManagement))
@@ -10331,19 +10340,25 @@ void QWidget::setWindowFlags(Qt::WindowFlags flags)
 void QWidgetPrivate::setWindowFlags(Qt::WindowFlags flags)
 {
     Q_Q(QWidget);
+    qDebug() << __FUNCTION__ << "###>" << q << "\n  flags=" << flags <<
+                "\n diff=" << (q->data->window_flags ^ flags);
     if (q->data->window_flags == flags)
         return;
 
     if ((q->data->window_flags | flags) & Qt::Window) {
         // the old type was a window and/or the new type is a window
         QPoint oldPos = q->pos();
+        qDebug() << __FUNCTION__ << q << "oldpos=" << oldPos;
         bool visible = q->isVisible();
         q->setParent(q->parentWidget(), flags);
 
         // if both types are windows or neither of them are, we restore
         // the old position
+        qDebug() << __FUNCTION__ << q << q->data->window_flags << "to" << flags
+                 << "ex=" << ((q->data->window_flags ^ flags) & Qt::Window);
         if (!((q->data->window_flags ^ flags) & Qt::Window)
             && (visible || q->testAttribute(Qt::WA_Moved))) {
+            qDebug() << __FUNCTION__ << "moving to oldpos=" << oldPos;
             q->move(oldPos);
         }
         // for backward-compatibility we change Qt::WA_QuitOnClose attribute value only when the window was recreated.
@@ -10351,6 +10366,7 @@ void QWidgetPrivate::setWindowFlags(Qt::WindowFlags flags)
     } else {
         q->data->window_flags = flags;
     }
+    qDebug() << __FUNCTION__ << "###<" << q;
 }
 
 /*!
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 872572a..20fcf87 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -731,6 +731,7 @@ void QWidgetWindow::updateNormalGeometry()
 
 void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
 {
+    qDebug() << __FUNCTION__ << geometry()<<  "->" << event->pos();
     if (updatePos())
         QGuiApplication::sendSpontaneousEvent(m_widget, event);
 }
@@ -738,6 +739,8 @@ void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
 void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
 {
     QSize oldSize = m_widget->data->crect.size();
+    qDebug() << __FUNCTION__ <<  "geometry=" << geometry() << "crect"
+             << m_widget->data->crect << "->" << event->size();
 
     if (updateSize()) {
         QGuiApplication::sendSpontaneousEvent(m_widget, event);
