diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 1e8ac60..ab1b5c6 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -48,6 +48,7 @@
 #include <QtGui/qwindow.h>
 #include <QtGui/qscreen.h>
 #include <private/qwindow_p.h>
+#include <QDebug>
 
 QT_BEGIN_NAMESPACE
 
@@ -500,6 +501,7 @@ bool QPlatformWindow::isAlertState() const
 QRect QPlatformWindow::initialGeometry(const QWindow *w,
     const QRect &initialGeometry, int defaultWidth, int defaultHeight)
 {
+    qDebug() << __FUNCTION__ << w << initialGeometry;
     QRect rect(initialGeometry);
     if (rect.isNull()) {
         QSize minimumSize = w->minimumSize();
@@ -522,6 +524,7 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w,
             rect.moveCenter(scr->availableGeometry().center());
         }
     }
+    qDebug() << __FUNCTION__ << '<' << w << rect;
     return rect;
 }
 
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 0dd85f2..6ff1cc8 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1298,6 +1298,7 @@ void QWindow::setGeometry(const QRect &rect)
     QRect oldRect = geometry();
 
     d->positionPolicy = QWindowPrivate::WindowFrameExclusive;
+    qDebug() << __FUNCTION__ << this << rect;
     if (d->platformWindow) {
         d->platformWindow->setGeometry(rect);
     } else {
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 8e9fcc4..5c2a0b7 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -216,7 +216,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
     m_contentView = m_qtView;
     setGeometry(tlw->geometry());
     recreateWindow(parent());
-    tlw->setGeometry(geometry());
+ //   tlw->setGeometry(geometry());
     m_inConstructor = false;
 }
 
@@ -239,9 +239,7 @@ void QCocoaWindow::setGeometry(const QRect &rect)
 {
     if (geometry() == rect)
         return;
-#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
-    qDebug() << "QCocoaWindow::setGeometry" << this << rect;
-#endif
+    qDebug() << "QCocoaWindow::setGeometry" << this << window() << rect;
     QPlatformWindow::setGeometry(rect);
     setCocoaGeometry(rect);
 }
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index cb7761a..b9d7db6 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -6502,17 +6502,21 @@ void QWidget::resize(const QSize &s)
     Q_D(QWidget);
     setAttribute(Qt::WA_Resized);
     if (testAttribute(Qt::WA_WState_Created)) {
+        qDebug() << __FUNCTION__ << '>' << this << geometry() << '1' << s;
         d->fixPosIncludesFrame();
         d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false);
         d->setDirtyOpaqueRegion();
-    } else {
+        qDebug() << __FUNCTION__ << '<' << this << geometry() << '1' ;
+    } else {        
         data->crect.setSize(s.boundedTo(maximumSize()).expandedTo(minimumSize()));
+        qDebug() << __FUNCTION__ << '2' << data->crect;
         setAttribute(Qt::WA_PendingResizeEvent);
     }
 }
 
 void QWidget::setGeometry(const QRect &r)
 {
+     qDebug() << __FUNCTION__ <<  this << geometry() << r;
     Q_D(QWidget);
     setAttribute(Qt::WA_Resized);
     setAttribute(Qt::WA_Moved);
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index a4da988..c23d33c 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -137,7 +137,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
     qt_window_private(win)->positionPolicy = topData()->posIncludesFrame ?
         QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
     win->create();
-
+    qDebug() << __FUNCTION__ << q << q->geometry();
     data.window_flags = win->flags();
 
     QBackingStore *store = q->backingStore();
@@ -689,7 +689,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
     QPoint oldp = q->geometry().topLeft();
     QSize olds = q->size();
     QRect r(x, y, w, h);
-
+    qDebug() << __FUNCTION__ <<  q << q->geometry() << r;
     bool isResize = olds != r.size();
     isMove = oldp != r.topLeft(); //### why do we have isMove as a parameter?
 
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index bedcfe7..88a7b12 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -501,6 +501,7 @@ void QWidgetWindow::handleKeyEvent(QKeyEvent *event)
 
 void QWidgetWindow::updateGeometry()
 {
+    qDebug() << __FUNCTION__ << m_widget << geometry();
     if (m_widget->testAttribute(Qt::WA_OutsideWSRange))
         return;
 
@@ -516,6 +517,7 @@ void QWidgetWindow::updateGeometry()
 void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
 {
     updateGeometry();
+    qDebug() << __FUNCTION__ << m_widget << m_widget->geometry();
     QGuiApplication::sendSpontaneousEvent(m_widget, event);
 }
 
