diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index e262f3f..306eaee 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -473,6 +473,8 @@ QWindow::SurfaceType QWindow::surfaceType() const
 void QWindow::setVisible(bool visible)
 {
     Q_D(QWindow);
+    if (objectName().contains(QLatin1String("Menu"),Qt::CaseInsensitive))
+        qDebug() << "QWindow::setVisible" << this << visible << geometry();
 
     if (d->visible == visible)
         return;
@@ -2300,7 +2302,12 @@ QPoint QWindow::mapToGlobal(const QPoint &pos) const
         && (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded())) {
         return d->platformWindow->mapToGlobal(pos);
     }
-    return pos + d->globalPosition();
+    QPoint r = pos + d->globalPosition();
+    qDebug() << " QWindow::mapToGlobal"
+             << "visible=" << isVisible()
+             << "platwin=" << d->platformWindow
+             << pos << "rets" << r;
+    return r;
 }
 
 
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index c49682c..086732f 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1110,6 +1110,9 @@ void QWindowsWindow::setVisible(bool visible)
 {
     const QWindow *win = window();
     qCDebug(lcQpaWindows) << __FUNCTION__ << this << win << m_data.hwnd << visible;
+    if (visible &&win->objectName().contains(QLatin1String("Menu"), Qt::CaseInsensitive)) {
+        qDebug() << __FUNCTION__ << win << visible << win->geometry();
+    }
     if (m_data.hwnd) {
         if (visible) {
             show_sys();
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 27e977f..b75e742 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -510,6 +510,8 @@ void QMenuPrivate::hideMenu(QMenu *menu)
 
 void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst)
 {
+    qDebug() << __FUNCTION__ << "action=" << action << "delay=" << delay << "activateFirst="
+             << activateFirst;
     Q_Q(QMenu);
     if (action) {
         if (action->isEnabled()) {
@@ -571,6 +573,7 @@ void QMenuPrivate::setFirstActionActive()
 // popup == -1 means do not popup, 0 means immediately, others mean use a timer
 void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason reason, bool activateFirst)
 {
+    qDebug() << "action=" << action << "popup=" << popup;
     Q_Q(QMenu);
     tearoffHighlighted = 0;
 
@@ -602,8 +605,10 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
                 // if the menu is visible then activate the required action,
                 // otherwise we just mark the action as currentAction
                 // and activate it when the menu will be popuped.
-                if (q->isVisible())
+                if (q->isVisible()) {
+                    qDebug() << "Calling popupAction";
                     popupAction(currentAction, popup, activateFirst);
+                }
             }
             q->update(actionRect(action));
 
@@ -1964,6 +1969,7 @@ void QMenu::hideTearOffMenu()
 */
 void QMenu::setActiveAction(QAction *act)
 {
+    qDebug() << __FUNCTION__  << act;
     Q_D(QMenu);
     d->setCurrentAction(act, 0);
     if (d->scroll)
@@ -2095,6 +2101,7 @@ QSize QMenu::sizeHint() const
 */
 void QMenu::popup(const QPoint &p, QAction *atAction)
 {
+    qDebug() << __FUNCTION__ << this << p << atAction;
     Q_D(QMenu);
     if (d->scroll) { // reset scroll state from last popup
         if (d->scroll->scrollOffset)
@@ -2692,8 +2699,10 @@ QMenu::event(QEvent *e)
         }
     } break;
     case QEvent::ContextMenu:
+        qDebug() << __FUNCTION__ << e;
         if (d->delayState.timer.isActive()) {
             d->delayState.stop();
+            qDebug() << __FUNCTION__ << "Calling internalDelayedPopup";
             internalDelayedPopup();
         }
         break;
@@ -3190,6 +3199,7 @@ QMenu::timerEvent(QTimerEvent *e)
             return;
         d->delayState.stop();
         d->sloppyState.stopTimer();
+        qDebug() << __FUNCTION__ << "Calling internalDelayedPopup";
         internalDelayedPopup();
     } else if (d->sloppyState.isTimerId(e->timerId())) {
         d->sloppyState.timeout();
@@ -3321,6 +3331,7 @@ void QMenu::actionEvent(QActionEvent *e)
 */
 void QMenu::internalDelayedPopup()
 {
+    qDebug() << __FUNCTION__ << this;
     Q_D(QMenu);
     //hide the current item
     if (QMenu *menu = d->activeMenu) {
@@ -3339,10 +3350,15 @@ void QMenu::internalDelayedPopup()
 
     int subMenuOffset = style()->pixelMetric(QStyle::PM_SubMenuOverlap, 0, this);
     const QRect actionRect(d->actionRect(d->currentAction));
-    const QPoint rightPos(mapToGlobal(QPoint(actionRect.right() + subMenuOffset + 1, actionRect.top())));
+    QPoint up = QPoint(actionRect.right() + subMenuOffset + 1, actionRect.top());
+    const QPoint rightPos(mapToGlobal(up));
+    qDebug() << __FUNCTION__ << "activeMenu=" << d->activeMenu << "actionRect=" << actionRect
+               << "up=" << up << "rightPos=" <<rightPos;
+
 
     QPoint pos(rightPos);
 
+
     d->activeMenu->popup(pos);
     d->sloppyState.setSubMenuPopup(actionRect, d->currentAction, d->activeMenu);
 }
