diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 4a40dd7..1cdf22c 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -290,6 +290,7 @@ QWindow::Visibility QWindow::visibility() const
 
 void QWindow::setVisibility(Visibility v)
 {
+    qDebug() << __FUNCTION__ << this << v;
     switch (v) {
     case Hidden:
         hide();
@@ -414,6 +415,7 @@ QWindow::SurfaceType QWindow::surfaceType() const
 */
 void QWindow::setVisible(bool visible)
 {
+    qDebug() << __FUNCTION__ << this << visible;
     Q_D(QWindow);
 
     if (d->visible == visible)
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index c44be64..496d444 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -52,6 +52,12 @@
 
 QT_BEGIN_NAMESPACE
 
+Q_GUI_EXPORT QDebug operator<<(QDebug d, const QBackingStore *bs)
+{
+    d.nospace() << "QBackingStore" << bs->window();
+    return d;
+}
+
 class QBackingStorePrivate
 {
 public:
@@ -130,6 +136,7 @@ QBackingStore::QBackingStore(QWindow *window)
     : d_ptr(new QBackingStorePrivate(window))
 {
     d_ptr->platformBackingStore = QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(window);
+    qDebug() << __FUNCTION__ << this;
 }
 
 /*!
diff --git a/src/gui/painting/qbackingstore.h b/src/gui/painting/qbackingstore.h
index 65efab2..af7f019 100644
--- a/src/gui/painting/qbackingstore.h
+++ b/src/gui/painting/qbackingstore.h
@@ -56,6 +56,7 @@ class QPoint;
 class QImage;
 class QBackingStorePrivate;
 class QPlatformBackingStore;
+class QDebug;
 
 class Q_GUI_EXPORT QBackingStore
 {
@@ -89,6 +90,8 @@ private:
     QScopedPointer<QBackingStorePrivate> d_ptr;
 };
 
+Q_GUI_EXPORT QDebug operator<<(QDebug d, const QBackingStore *bs);
+
 QT_END_NAMESPACE
 
 #endif // QBACKINGSTORE_H
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 26205eb..96ff757 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -81,6 +81,7 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
                                         const QPoint &offset)
 {
     Q_ASSERT(window);
+    qDebug() << __FUNCTION__ << window << region << offset;
 
     const QRect br = region.boundingRect();
     if (QWindowsContext::verboseBackingStore > 1)
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 5804712..bd63cb3 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -940,10 +940,15 @@ QWindowsWindow::~QWindowsWindow()
 
 void QWindowsWindow::fireExpose(const QRegion &region, bool force)
 {
+    qDebug() << __FUNCTION__ << window() << region
+             << "isExposed" << isExposed() << "forced"<< force;
+    if (region.isEmpty())
+        qDebug("EMPTY");
     if (region.isEmpty() && !force)
         clearFlag(Exposed);
     else
         setFlag(Exposed);
+    qDebug() << __FUNCTION__ << window() << region << isExposed();
     QWindowSystemInterface::handleExposeEvent(window(), region);
 }
 
@@ -1048,8 +1053,8 @@ QWindowsWindow::WindowData
 
 void QWindowsWindow::setVisible(bool visible)
 {
-    if (QWindowsContext::verboseWindows)
-        qDebug() << __FUNCTION__ << this << window() << m_data.hwnd << visible;
+    if (1 || QWindowsContext::verboseWindows)
+        qDebug() << __FUNCTION__ << this << window() << m_data.hwnd << visible << "LAYERED"<< isLayered();
     if (m_data.hwnd) {
         if (visible) {
             show_sys();
@@ -1076,6 +1081,14 @@ bool QWindowsWindow::isVisible() const
     return m_data.hwnd && IsWindowVisible(m_data.hwnd);
 }
 
+bool QWindowsWindow::isExposed() const
+{
+    const bool e = testFlag(Exposed);
+    const bool v = isVisible();
+    qDebug() << __FUNCTION__ << window() <<  e << v;
+    return e;
+}
+
 bool QWindowsWindow::isActive() const
 {
     // Check for native windows or children of the active native window.
@@ -1411,11 +1424,16 @@ void QWindowsWindow::releaseDC()
 bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
                                          WPARAM, LPARAM)
 {
+    qDebug() << __FUNCTION__ << window();
     // Ignore invalid update bounding rectangles
-    if (!GetUpdateRect(m_data.hwnd, 0, FALSE))
+    if (!GetUpdateRect(m_data.hwnd, 0, FALSE)) {
+        qErrnoWarning("GetUpdateRect");
         return false;
-    if (message == WM_ERASEBKGND) // Backing store - ignored.
+    }
+    if (message == WM_ERASEBKGND) { // Backing store - ignored. {
+        qDebug() <<"WM_ERASEBKGND";
         return true;
+    }
     PAINTSTRUCT ps;
 
     // Observed painting problems with Aero style disabled (QTBUG-7865).
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index f055864..c40b2ce 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -164,7 +164,7 @@ public:
 
     virtual void setVisible(bool visible);
     bool isVisible() const;
-    virtual bool isExposed() const { return testFlag(Exposed); }
+    virtual bool isExposed() const;
     virtual bool isActive() const;
     virtual bool isEmbedded(const QPlatformWindow *parentWindow) const;
     virtual QPoint mapToGlobal(const QPoint &pos) const;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 933294e..c7fd3eb 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1680,12 +1680,14 @@ void QWidgetPrivate::syncBackingStore()
         repaint_sys(dirty);
         dirty = QRegion();
     } else if (QWidgetBackingStore *bs = maybeBackingStore()) {
+        qDebug() << __FUNCTION__ << q_func();
         bs->sync();
     }
 }
 
 void QWidgetPrivate::syncBackingStore(const QRegion &region)
 {
+    qDebug() << __FUNCTION__ << q_func() << region;
     if (paintOnScreen())
         repaint_sys(region);
     else if (QWidgetBackingStore *bs = maybeBackingStore()) {
@@ -8234,6 +8236,7 @@ bool QWidget::event(QEvent *event)
         changeEvent(event);
         break;
     case QEvent::UpdateRequest:
+        qDebug() << __FUNCTION__ << "QEvent::UpdateRequest" << this;
         d->syncBackingStore();
         break;
     case QEvent::UpdateLater:
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index ae8a0b2..d88b598 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -503,6 +503,7 @@ void QWidgetPrivate::fixPosIncludesFrame()
 void QWidgetPrivate::show_sys()
 {
     Q_Q(QWidget);
+    qDebug() << __FUNCTION__ << q ;
 
     QWindow *window = q->windowHandle();
 
@@ -518,8 +519,10 @@ void QWidgetPrivate::show_sys()
 
     QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
 
-    if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow))
+    if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow)) {
+        qDebug() << __FUNCTION__ << "RET Qt::WA_NativeWindow" ;
         return;
+    }
 
     if (window) {
         if (q->isWindow())
@@ -548,6 +551,7 @@ void QWidgetPrivate::show_sys()
         qt_qpa_set_cursor(q, false); // Needed in case cursor was set before show
 #endif
         invalidateBuffer(q->rect());
+        qDebug() << __FUNCTION__ << q << "setVisible(true)";
         window->setVisible(true);
         // Was the window moved by the Window system or QPlatformWindow::initialGeometry() ?
         if (window->isTopLevel()) {
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 02fa80b..577c722 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -64,6 +64,12 @@
 
 QT_BEGIN_NAMESPACE
 
+QDebug operator<<(QDebug d, const QWidgetBackingStore *bs)
+{
+    d.nospace() << "QWidgetBackingStore of "<<bs->tlw;
+    return d;
+}
+
 extern QRegion qt_dirtyRegion(QWidget *);
 
 /*
@@ -83,6 +89,7 @@ static inline bool qRectIntersects(const QRect &r1, const QRect &r2)
 static inline void qt_flush(QWidget *widget, const QRegion &region, QBackingStore *backingStore,
                             QWidget *tlw, const QPoint &tlwOffset)
 {
+    qDebug() << __FUNCTION__ <<  widget << region << backingStore << "TLW" << tlw << tlwOffset;
     Q_ASSERT(widget);
     Q_ASSERT(!region.isEmpty());
     Q_ASSERT(backingStore);
@@ -714,6 +721,7 @@ void QWidgetBackingStore::updateLists(QWidget *cur)
 QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel)
     : tlw(topLevel), dirtyOnScreenWidgets(0), fullUpdatePending(0)
 {
+    qDebug() << __FUNCTION__ << this;
     store = tlw->backingStore();
     Q_ASSERT(store);
 
@@ -885,10 +893,11 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
 
 static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
 {
-    if (!tlw || !tlwExtra || !tlw->testAttribute(Qt::WA_Mapped) || !tlw->isVisible())
-        return true;
+    bool rc =!tlw || !tlwExtra || !tlw->testAttribute(Qt::WA_Mapped) || !tlw->isVisible();
+    qDebug() << __FUNCTION__<< tlw << "MAPPED " << tlw->testAttribute(Qt::WA_Mapped)
+                << "VIsible" << tlw->isVisible()<< "returns " << rc;
 
-    return false;
+    return rc;
 }
 
 /*!
@@ -900,6 +909,7 @@ static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
 */
 void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedRegion)
 {
+    qDebug() << "QWidgetBackingStore::sync(QWidget,QRegion)"<< this << "exposedWidget=" << exposedWidget << exposedRegion;
     QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
     if (discardSyncRequest(tlw, tlwExtra) || tlwExtra->inTopLevelResize)
         return;
@@ -928,7 +938,9 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
 void QWidgetBackingStore::sync()
 {
     QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
+    qDebug() << "QWidgetBackingStore::sync()" << this;
     if (discardSyncRequest(tlw, tlwExtra)) {
+        qDebug() << __FUNCTION__  << "DISCARDED" << this;
         // If the top-level is minimized, it's not visible on the screen so we can delay the
         // update until it's shown again. In order to do that we must keep the dirty states.
         // These will be cleared when we receive the first expose after showNormal().
@@ -943,6 +955,7 @@ void QWidgetBackingStore::sync()
         }
         return;
     }
+    qDebug() << __FUNCTION__  << "SYNCING" << this;
 
     const bool updatesDisabled = !tlw->updatesEnabled();
     bool repaintAllWidgets = false;
@@ -1100,6 +1113,7 @@ void QWidgetBackingStore::sync()
 */
 void QWidgetBackingStore::flush(QWidget *widget)
 {
+    qDebug() << __FUNCTION__  << this << "widget: " << widget;
     if (!dirtyOnScreen.isEmpty()) {
         QWidget *target = widget ? widget : tlw;
         qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset);
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
index 39583c8..9c81c09 100644
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ b/src/widgets/kernel/qwidgetbackingstore_p.h
@@ -95,6 +95,7 @@ public:
                    bool invalidateBuffer = false);
 
 private:
+    friend QDebug operator<<(QDebug d, const QWidgetBackingStore *bs);
     QWidget *tlw;
     QRegion dirtyOnScreen; // needsFlush
     QRegion dirty; // needsRepaint
@@ -249,6 +250,8 @@ private:
     friend class QBackingStore;
 };
 
+QDebug operator<<(QDebug d, const QWidgetBackingStore *bs);
+
 QT_END_NAMESPACE
 
 #endif // QBACKINGSTORE_P_H
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 2e96247..237af30 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -551,6 +551,7 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
     updateGeometry();
     QGuiApplication::sendSpontaneousEvent(m_widget, event);
 
+    qDebug() << __FUNCTION__ << m_widget;
     if (m_widget->d_func()->paintOnScreen()) {
         QRegion updateRegion(geometry());
         if (m_widget->testAttribute(Qt::WA_StaticContents))
@@ -663,8 +664,10 @@ void QWidgetWindow::handleDropEvent(QDropEvent *event)
 
 void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
 {
+    qDebug() << __FUNCTION__ << m_widget << isExposed() << event->region();
     if (isExposed()) {
         m_widget->setAttribute(Qt::WA_Mapped);
+        qDebug() << __FUNCTION__ << m_widget << "Setting mapped";
         if (!event->region().isNull()) {
             // Exposed native widgets need to be marked dirty to get them repainted correctly.
             if (m_widget->internalWinId() && !m_widget->isWindow() && m_widget->isVisible() && m_widget->updatesEnabled()) {
