diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 9f2c6af..0a7c1dd 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -588,6 +588,7 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w,
     if (!screen)
         return initialGeometry;
     QRect rect(QHighDpi::fromNativePixels(initialGeometry, w));
+    qDebug() << __FUNCTION__ << w << w->screen() << rect;
     if (rect.width() == 0) {
         const int minWidth = w->minimumWidth();
         rect.setWidth(minWidth > 0 ? minWidth : defaultWidth);
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 7f84706..62d8e26 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -368,6 +368,8 @@ void QWindowPrivate::emitScreenChangedRecursion(QScreen *newScreen)
 void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate)
 {
     Q_Q(QWindow);
+    qDebug() << __FUNCTION__ << q << newScreen;
+
     if (parentWindow) {
         qWarning() << q << '(' << newScreen << "): Attempt to set a screen on a child window.";
         return;
@@ -391,7 +393,7 @@ void QWindowPrivate::create(bool recursive)
     Q_Q(QWindow);
     if (platformWindow)
         return;
-
+qDebug() << __FUNCTION__ << q << q->geometry() << recursive;
     platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q);
     Q_ASSERT(platformWindow);
 
@@ -1435,6 +1437,7 @@ void QWindow::setGeometry(int posx, int posy, int w, int h)
 */
 void QWindow::setGeometry(const QRect &rect)
 {
+    qDebug() << __FUNCTION__ << this << rect;
     Q_D(QWindow);
     d->positionAutomatic = false;
     if (rect == geometry())
@@ -1449,6 +1452,7 @@ void QWindow::setGeometry(const QRect &rect)
             nativeRect = QHighDpi::toNativePixels(rect, newScreen);
         else
             nativeRect = QHighDpi::toNativePixels(rect, this);
+        qDebug() << __FUNCTION__ << this << "nativeRect=" <<nativeRect;
         d->platformWindow->setGeometry(nativeRect);
     } else {
         d->geometry = rect;
@@ -1570,6 +1574,7 @@ void QWindow::setFramePosition(const QPoint &point)
 */
 void QWindow::setPosition(const QPoint &pt)
 {
+    qDebug() << __FUNCTION__ << this << pt;
     setGeometry(QRect(pt, size()));
 }
 
@@ -1617,7 +1622,12 @@ void QWindow::resize(const QSize &newSize)
 {
     Q_D(QWindow);
     if (d->platformWindow) {
-        d->platformWindow->setGeometry(QHighDpi::toNativePixels(QRect(position(), newSize), this));
+        QRect noR(position(), newSize);
+        QRect  npr = QHighDpi::toNativePixels(noR, this);
+        qDebug() << __FUNCTION__ << this
+                 << screen() << "P=" << parent()
+                 << noR << npr;
+        d->platformWindow->setGeometry(npr);
     } else {
         const QSize oldSize = d->geometry.size();
         d->geometry.setSize(newSize);
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index cae9760..6f5cdcd 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -124,6 +124,7 @@ void QWindowSystemInterface::handleWindowStateChanged(QWindow *tlw, Qt::WindowSt
 
 void QWindowSystemInterface::handleWindowScreenChanged(QWindow *tlw, QScreen *screen)
 {
+    qDebug() << __FUNCTION__ <<  tlw << screen;
     QWindowSystemInterfacePrivate::WindowScreenChangedEvent *e =
         new QWindowSystemInterfacePrivate::WindowScreenChangedEvent(tlw, screen);
     QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
@@ -142,6 +143,9 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
  */
 void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
 {
+    qDebug() << __FUNCTION__ << tlw << newRect << oldRect;
+    if (newRect.x() < -2000)
+        qDebug("--!2");
     QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw, QHighDpi::fromNativePixels(newRect, tlw), QHighDpi::fromNativePixels(oldRect, tlw));
     QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
 }
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 09c2f7d..bad93b3 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -1019,9 +1019,13 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
             return true;
 #endif
         case QtWindows::ResizeEvent:
+            qDebug() << __FUNCTION__ << "crea" << QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
             d->m_creationContext->obtainedGeometry.setSize(QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
             return true;
         case QtWindows::MoveEvent:
+            qDebug() << __FUNCTION__ << "crea" << GET_X_LPARAM(lParam) <<  GET_Y_LPARAM(lParam);
+            if (GET_X_LPARAM(lParam) < 0)
+                qDebug() << "--3!";
             d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
             return true;
         case QtWindows::CalculateSize:
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 968ef7b..ce20a78 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -303,8 +303,8 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
         requested.customMargins = qvariant_cast<QMargins>(customMarginsV);
 
     QWindowsWindowData obtained = QWindowsWindowData::create(window, requested, window->title());
-    qCDebug(lcQpaWindows).nospace()
-        << __FUNCTION__ << ' ' << window
+    qDebug().nospace()
+        << __FUNCTION__ << ' ' << window << "par=" << window->parent()
         << "\n    Requested: " << requested.geometry << " frame incl.="
         << QWindowsGeometryHint::positionIncludesFrame(window)
         << ' ' << requested.flags
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 9c6cb53..6606fd8 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -644,6 +644,7 @@ QWindowsWindowData
     const QString windowClassName = QWindowsContext::instance()->registerWindowClass(w);
 
     const QRect rect = QPlatformWindow::initialGeometry(w, data.geometry, defaultWindowWidth, defaultWindowHeight);
+    qDebug() << __FUNCTION__ << data.geometry << rect;
 
     if (title.isEmpty() && (result.flags & Qt::WindowTitleHint))
         title = topLevel ? qAppName() : w->objectName();
@@ -656,7 +657,7 @@ QWindowsWindowData
     const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle));
     QWindowsContext::instance()->setWindowCreationContext(context);
 
-    qCDebug(lcQpaWindows).nospace()
+    qDebug().nospace()
         << "CreateWindowEx: " << w << " class=" << windowClassName << " title=" << title
         << '\n' << *this << "\nrequested: " << rect << ": "
         << context->frameWidth << 'x' <<  context->frameHeight
@@ -1391,6 +1392,9 @@ QRect QWindowsWindow::normalGeometry() const
 
 void QWindowsWindow::setGeometry(const QRect &rectIn)
 {
+    qDebug() << __FUNCTION__ << window() << rectIn;
+    if (rectIn.x() < -2000)
+        qDebug("-!!");
     QRect rect = rectIn;
     // This means it is a call from QWindow::setFramePosition() and
     // the coordinates include the frame (size is still the contents rectangle).
