diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f1d90f9caa..1c19d73e2b 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2457,9 +2457,11 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa
 
 void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse)
 {
+
     if (QWindow *window  = wse->window.data()) {
         if (window->screen() == wse->screen.data())
             return;
+        qDebug() << __FUNCTION__ << wse->window.data() <<  wse->screen->geometry() << "DPR=" << wse->screen->devicePixelRatio();
         if (QWindow *topLevelWindow = window->d_func()->topLevelWindow(QWindow::ExcludeTransients)) {
             if (QScreen *screen = wse->screen.data())
                 topLevelWindow->d_func()->setTopLevelScreen(screen, false /* recreate */);
@@ -2469,6 +2471,8 @@ void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterf
         // we may have changed scaling, so trigger resize event if needed
         if (window->handle()) {
             QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window));
+            qDebug() << __FUNCTION__ << "sending resize" << gce.newGeometry << "nativegeom="
+                     << window->handle()->geometry();
             processGeometryChangeEvent(&gce);
         }
     }
@@ -2497,6 +2501,7 @@ void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::
 
 void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e)
 {
+    qDebug() << __FUNCTION__ << e->window.data() << e->newGeometry;
     if (e->window.isNull())
        return;
 
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index def34f272c..5295796dee 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -654,6 +654,7 @@ static inline const QScreen *effectiveScreen(const QWindow *window)
         }
     }
 #endif
+    qDebug() << __FUNCTION__ << window << "rets" << screen;
     return screen;
 }
 
@@ -698,13 +699,16 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, const QRect &initialGeo
                                        int defaultWidth, int defaultHeight,
                                        const QScreen **resultingScreenReturn)
 {
+    qDebug() << __FUNCTION__  << w << initialGeometry;
     if (resultingScreenReturn)
         *resultingScreenReturn = w->screen();
     if (!w->isTopLevel()) {
         const qreal factor = QHighDpiScaling::factor(w);
         const QSize size = fixInitialSize(QHighDpi::fromNative(initialGeometry.size(), factor),
                                           w, defaultWidth, defaultHeight);
-        return QRect(initialGeometry.topLeft(), QHighDpi::toNative(size, factor));
+        auto  cr = QRect(initialGeometry.topLeft(), QHighDpi::toNative(size, factor));
+        qDebug() << __FUNCTION__  << "child rets=" << cr;
+        return cr;
     }
     const auto *wp = qt_window_private(const_cast<QWindow*>(w));
     const bool position = wp->positionAutomatic && w->type() != Qt::Popup;
@@ -737,7 +741,9 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, const QRect &initialGeo
             }
         }
     }
-    return QHighDpi::toNativePixels(rect, screen);
+    auto r = QHighDpi::toNativePixels(rect, screen);
+    qDebug() << __FUNCTION__  << "toplevel rets=" << r;
+    return r;
 }
 
 /*!
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 9cb851a7a2..c95966e564 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1656,6 +1656,7 @@ void QWindow::setGeometry(const QRect &rect)
     Q_D(QWindow);
     d->positionAutomatic = false;
     const QRect oldRect = geometry();
+    qDebug() << __FUNCTION__ << this << rect;
     if (rect == oldRect)
         return;
 
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index d31352b854..c36a496a5c 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -1391,11 +1391,12 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
         // WM_DPICHANGED is sent with a size that avoids resize loops (by
         // snapping back to the previous screen, see QTBUG-65580).
         const bool doResize = resizeOnDpiChanged(platformWindow->window());
+        qDebug() << __FUNCTION__ << "WM_DPICHANGED" << platformWindow->window() << "doResize=" << doResize;
         if (doResize) {
             platformWindow->setFlag(QWindowsWindow::WithinDpiChanged);
             platformWindow->updateFullFrameMargins();
             const auto prcNewWindow = reinterpret_cast<RECT *>(lParam);
-            qCDebug(lcQpaWindows) << __FUNCTION__ << "WM_DPICHANGED"
+            qDebug() << __FUNCTION__ << "WM_DPICHANGED"
                 << platformWindow->window() << *prcNewWindow;
             SetWindowPos(hwnd, nullptr, prcNewWindow->left, prcNewWindow->top,
                          prcNewWindow->right - prcNewWindow->left,
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 496b18ba1a..d50baafd41 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -781,7 +781,7 @@ QWindowsWindowData
     QMargins invMargins = topLevel && hasFrame && QWindowsGeometryHint::positionIncludesFrame(w)
             ? invisibleMargins(QPoint(context->frameX, context->frameY)) : QMargins();
 
-    qCDebug(lcQpaWindows).nospace()
+    qDebug().nospace()
         << "CreateWindowEx: " << w << " class=" << windowClassName << " title=" << title
         << '\n' << *this << "\nrequested: " << rect << ": "
         << context->frameWidth << 'x' <<  context->frameHeight
@@ -807,7 +807,7 @@ QWindowsWindowData
                                  pos.x(), pos.y(),
                                  context->frameWidth, context->frameHeight,
                                  parentHandle, nullptr, appinst, nullptr);
-    qCDebug(lcQpaWindows).nospace()
+    qDebug().nospace()
         << "CreateWindowEx: returns " << w << ' ' << result.hwnd << " obtained geometry: "
         << context->obtainedPos << context->obtainedSize << ' ' << context->margins;
 
@@ -1928,10 +1928,10 @@ void QWindowsWindow::checkForScreenChanged(ScreenChangeMode mode)
 {
     if (parent() || QWindowsScreenManager::isSingleScreen())
         return;
-
     QPlatformScreen *currentScreen = screen();
     const QWindowsScreen *newScreen =
         QWindowsContext::instance()->screenManager().screenForHwnd(m_data.hwnd);
+    qDebug() << __FUNCTION__ << window() << "mode=" << mode << "newScr=" << newScreen;
     if (newScreen == nullptr || newScreen == currentScreen)
         return;
     // For screens with different DPI: postpone until WM_DPICHANGE
@@ -1940,7 +1940,7 @@ void QWindowsWindow::checkForScreenChanged(ScreenChangeMode mode)
         && !equalDpi(currentScreen->logicalDpi(), newScreen->logicalDpi())) {
         return;
     }
-    qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__
+    qDebug().noquote().nospace() << __FUNCTION__
         << ' ' << window() << " \"" << (currentScreen ? currentScreen->name() : QString())
         << "\"->\"" << newScreen->name() << '"';
     if (mode == FromGeometryChange)
@@ -1975,7 +1975,7 @@ void QWindowsWindow::handleGeometryChange()
 
     if (!wasSync)
         clearFlag(SynchronousGeometryChangeEvent);
-    qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry;
+    qDebug() << __FUNCTION__ << this << window() << m_data.geometry;
 }
 
 void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
@@ -1983,7 +1983,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/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index e7f95ecf4d..c5c1e319ec 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7907,9 +7907,10 @@ void QWidgetPrivate::show_sys()
         invalidateBackingStore(q->rect());
         window->setNativeWindowVisibility(true);
         // Was the window moved by the Window system or QPlatformWindow::initialGeometry() ?
-        if (window->isTopLevel()) {
+        if (window->isTopLevel()) {            
             const QPoint crectTopLeft = q->data->crect.topLeft();
             const QPoint windowTopLeft = window->geometry().topLeft();
+            qDebug() << __FUNCTION__ << q << "resulting=" << windowTopLeft;
             if (crectTopLeft == QPoint(0, 0) && windowTopLeft != crectTopLeft)
                 q->data->crect.moveTopLeft(windowTopLeft);
         }
