diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 611d586..27634b6 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1367,11 +1367,14 @@ QRect QWindowsWindow::normalGeometry() const
     const bool fakeFullScreen = m_savedFrameGeometry.isValid() && window()->windowState() == Qt::WindowFullScreen;
     const QRect frame = fakeFullScreen ? m_savedFrameGeometry : normalFrameGeometry(m_data.hwnd);
     const QMargins margins = fakeFullScreen ? QWindowsGeometryHint::frame(m_savedStyle, 0) : frameMargins();
-    return frame.isValid() ? frame.marginsRemoved(margins) : frame;
+    QRect rc =frame.isValid() ? frame.marginsRemoved(margins) : frame;
+    qDebug() << __FUNCTION__ << rc << "fakeFullScreen=" << fakeFullScreen;
+    return rc;
 }
 
 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).
@@ -1440,11 +1443,15 @@ void QWindowsWindow::handleResized(int wParam)
 
 void QWindowsWindow::handleGeometryChange()
 {
+
     //Prevent recursive resizes for Windows CE
     if (testFlag(WithinSetStyle))
         return;
     const QRect previousGeometry = m_data.geometry;
     m_data.geometry = geometry_sys();
+    qDebug() << __FUNCTION__ << window() << previousGeometry << "->" <<  m_data.geometry;
+    if (m_data.geometry.width() == 1904)
+        qDebug("1904!!");
     QPlatformWindow::setGeometry(m_data.geometry);
     QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry);
     // QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive
@@ -1461,7 +1468,7 @@ void QWindowsWindow::handleGeometryChange()
     if (testFlag(SynchronousGeometryChangeEvent))
         QWindowSystemInterface::flushWindowSystemEvents();
 
-    qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry;
+    qDebug() << __FUNCTION__ << this << window() << m_data.geometry;
 }
 
 void QWindowsWindow::setGeometry_sys(const QRect &rect) const
@@ -1688,7 +1695,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
     const Qt::WindowState oldState = m_windowState;
     if (oldState == newState)
         return;
-    qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window()
+    qDebug() << '>' << __FUNCTION__ << this << window()
         << " from " << oldState << " to " << newState;
 
     const bool visible = isVisible();
@@ -1720,13 +1727,17 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
             if (!m_savedStyle) {
                 m_savedStyle = style();
 #ifndef Q_OS_WINCE
+                // ---> if (oldState == Qt::WindowMinimized || oldState == Qt::WindowMaximized) { ?!
                 if (oldState == Qt::WindowMinimized) {
                     const QRect nf = normalFrameGeometry(m_data.hwnd);
-                    if (nf.isValid())
+                    if (nf.isValid()) {
+                        qDebug() << __FUNCTION__ << "(from min) ng=" << nf;
                         m_savedFrameGeometry = nf;
+                    }
                 } else {
 #endif
                     m_savedFrameGeometry = frameGeometry_sys();
+                    qDebug() << __FUNCTION__ << "m_savedFrameGeometry=" << m_savedFrameGeometry;
 #ifndef Q_OS_WINCE
                 }
 #endif
@@ -1762,14 +1773,19 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
                 swpf |= SWP_NOSIZE | SWP_NOMOVE;
             const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
             setFlag(SynchronousGeometryChangeEvent);
-            SetWindowPos(m_data.hwnd, 0, m_savedFrameGeometry.x(), m_savedFrameGeometry.y(),
+            qDebug() << __FUNCTION__ << "restoring" << m_savedFrameGeometry << hex<<showbase << swpf;
+            BOOL r = SetWindowPos(m_data.hwnd, 0, m_savedFrameGeometry.x(), m_savedFrameGeometry.y(),
                          m_savedFrameGeometry.width(), m_savedFrameGeometry.height(), swpf);
+            qDebug() << __FUNCTION__ << "SetWindowPos() rets" << r;
             if (!wasSync)
                 clearFlag(SynchronousGeometryChangeEvent);
             // preserve maximized state
             if (visible) {
                 setFlag(WithinMaximize);
-                ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
+                int cmdShow = (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE;
+                qDebug() << "ShowWindow" << cmdShow;
+                BOOL r = ShowWindow(m_data.hwnd, cmdShow);
+                qDebug() << "ShowWindow rets" << r;
                 clearFlag(WithinMaximize);
             }
             m_savedStyle = 0;
@@ -1791,7 +1807,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
             ShowWindow(m_data.hwnd, (newState == Qt::WindowMinimized) ? SW_MINIMIZE :
                        (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNORMAL);
     }
-    qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << this << window() << newState;
+    qDebug() << '<' << __FUNCTION__ << this << window() << newState;
 }
 
 void QWindowsWindow::setStyle(unsigned s) const
