diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f59c7dc..581fe33 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -436,8 +436,14 @@ QWindow *QGuiApplication::modalWindow()
 void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window)
 {
     bool shouldBeBlocked = false;
-    if ((window->windowType() & Qt::Popup) != Qt::Popup && !self->modalWindowList.isEmpty())
+    if ((window->windowType() & Qt::Popup) != Qt::Popup && !self->modalWindowList.isEmpty()) {
+        qDebug() << __FUNCTION__ << "checking on " << window;
         shouldBeBlocked = self->isWindowBlocked(window);
+    } else {
+        qDebug() <<  __FUNCTION__ << "no check on " << window;
+    }
+    qDebug() << __FUNCTION__ << window << shouldBeBlocked;
+
 
     if (shouldBeBlocked != window->d_func()->blockedByModalWindow) {
         QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked);
@@ -449,6 +455,7 @@ void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window)
 
 void QGuiApplicationPrivate::showModalWindow(QWindow *modal)
 {
+    qDebug() << __FUNCTION__ << '>' << modal;
     self->modalWindowList.prepend(modal);
 
     QEvent e(QEvent::WindowBlocked);
@@ -458,10 +465,12 @@ void QGuiApplicationPrivate::showModalWindow(QWindow *modal)
         if (!window->d_func()->blockedByModalWindow)
             updateBlockedStatus(window);
     }
+    qDebug() << __FUNCTION__ << '<' << modal;
 }
 
 void QGuiApplicationPrivate::hideModalWindow(QWindow *window)
 {
+    qDebug() << __FUNCTION__ << '>' << window;
     self->modalWindowList.removeAll(window);
 
     QEvent e(QEvent::WindowUnblocked);
@@ -471,6 +480,7 @@ void QGuiApplicationPrivate::hideModalWindow(QWindow *window)
         if (window->d_func()->blockedByModalWindow)
             updateBlockedStatus(window);
     }
+    qDebug() << __FUNCTION__ << '<' << window;
 }
 
 /*
@@ -480,11 +490,13 @@ void QGuiApplicationPrivate::hideModalWindow(QWindow *window)
 */
 bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const
 {
+    qDebug()  << __FUNCTION__ << window << ">";
     QWindow *unused = 0;
     if (!blockingWindow)
         blockingWindow = &unused;
 
     if (modalWindowList.isEmpty()) {
+        qDebug()  << __FUNCTION__ << window << "FALSE: no modal wins";
         *blockingWindow = 0;
         return false;
     }
@@ -498,6 +510,7 @@ bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blocking
             while (w) {
                 if (w == modalWindow) {
                     *blockingWindow = 0;
+                    qDebug()  << __FUNCTION__ << window << "FALSE: same hierarchy";
                     return false;
                 }
                 QWindow *p = w->parent();
@@ -513,6 +526,7 @@ bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blocking
         {
             if (modalWindow != window) {
                 *blockingWindow = modalWindow;
+                qDebug()  << __FUNCTION__ << window << "TRUE : App modal by" << modalWindow;
                 return true;
             }
             break;
@@ -525,6 +539,7 @@ bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blocking
                 do {
                     if (m == w) {
                         *blockingWindow = m;
+                        qDebug()  << __FUNCTION__ << window << "TRUE : Window modal blocked by " << m;
                         return true;
                     }
                     QWindow *p = m->parent();
@@ -545,6 +560,7 @@ bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blocking
         }
     }
     *blockingWindow = 0;
+    qDebug()  << __FUNCTION__ << window << "false end ";
     return false;
 }
 
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index fe95f58..634361a 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2288,6 +2288,7 @@ bool QApplicationPrivate::isBlockedByModal(QWidget *widget)
 
 bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const
 {
+    qDebug() << __FUNCTION__ << window;
     QWindow *unused = 0;
     if (!blockingWindow)
         blockingWindow = &unused;
@@ -2300,6 +2301,7 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
     QWindow *popupWindow = popupWidget ? popupWidget->windowHandle() : 0;
     if (popupWindow == window) {
         *blockingWindow = 0;
+        qDebug() << __FUNCTION__ << window << "FALSE active popup";
         return false;
     }
 
@@ -2312,6 +2314,7 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
             while (w) {
                 if (w == modalWindow) {
                     *blockingWindow = 0;
+                    qDebug() << __FUNCTION__ << window << "FALSE in hierarchy";
                     return false;
                 }
                 QWindow *p = w->parent();
@@ -2324,8 +2327,10 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
             // so check the native parent chain, too.
             const QPlatformWindow *platWin = window->handle();
             const QPlatformWindow *modalPlatWin = modalWindow->handle();
-            if (platWin && modalPlatWin && platWin->isEmbedded(modalPlatWin))
+            if (platWin && modalPlatWin && platWin->isEmbedded(modalPlatWin)) {
+                qDebug() << __FUNCTION__ << window << "FALSE embedded";
                 return false;
+            }
         }
 
         Qt::WindowModality windowModality = modalWindow->windowModality();
@@ -2361,10 +2366,12 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
                     m = m->parentWidget();
                 if (m == groupLeaderForWidget) {
                     *blockingWindow = m->windowHandle();
+                    qDebug() << __FUNCTION__ << window << "true groupLeaderForWidget" << m;
                     return true;
                 }
             } else if (modalWindow != window) {
                 *blockingWindow = modalWindow;
+                qDebug() << __FUNCTION__ << window << "true modalWindow != window" << modalWindow;
                 return true;
             }
             break;
@@ -2377,6 +2384,7 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
                 do {
                     if (m == w) {
                         *blockingWindow = m;
+                        qDebug() << __FUNCTION__ << window << "true WindowModal" << m;
                         return true;
                     }
                     QWindow *p = m->parent();
@@ -2397,6 +2405,7 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin
         }
     }
     *blockingWindow = 0;
+    qDebug() << __FUNCTION__ << window << "end false";
     return false;
 }
 
