diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 51b458f03a..c8eef4715a 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2316,6 +2316,7 @@ QSize QMenu::sizeHint() const
 */
 void QMenu::popup(const QPoint &p, QAction *atAction)
 {
+    qDebug() << __FUNCTION__ << p << atAction <<"useFullScreenForPopup=" << QStylePrivate::useFullScreenForPopup();
     Q_D(QMenu);
     if (d->scroll) { // reset scroll state from last popup
         if (d->scroll->scrollOffset)
@@ -2358,7 +2359,9 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
 #endif
 
     ensurePolished(); // Get the right font
+    qDebug() << __FUNCTION__ << ">emitting aboutToShow!";
     emit aboutToShow();
+    qDebug() << __FUNCTION__ << "<emitted aboutToShow!";
     const bool actionListChanged = d->itemsDirty;
 
     QRect screen;
@@ -2391,6 +2394,9 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
         size.setHeight(qMin(menuSizeHint.height(), screen.height() - desktopFrame * 2));
         adjustToDesktop = true;
     }
+    qDebug() << __FUNCTION__ << "screen=" << screen << "pos=" << pos << "size=" << size
+        << "bottomRight=" << QRect(pos, size).bottomRight() <<  "adjustToDesktop="
+        << adjustToDesktop << "desktopFrame=" << desktopFrame;
 
 #ifdef QT_KEYPAD_NAVIGATION
     if (!atAction && QApplicationPrivate::keypadNavigationEnabled()) {
@@ -2440,6 +2446,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
     QPoint mouse = QCursor::pos();
     d->mousePopupPos = mouse;
     const bool snapToMouse = !d->causedPopup.widget && (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse));
+    qDebug() << __FUNCTION__ << "**MOUSE**=" << mouse << "snapToMouse=" << snapToMouse;
 
     if (adjustToDesktop) {
         // handle popup falling "off screen"
@@ -2462,12 +2469,16 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
                 pos.setX(screen.right() - desktopFrame - size.width() + 1);
             if (pos.x() < screen.left() + desktopFrame)
                 pos.setX(screen.left() + desktopFrame);
+            qDebug() << __FUNCTION__ << "adj_dt_X=" << pos
+                     << "bottomRight=" << QRect(pos, size).bottomRight();
         }
         if (pos.y() + size.height() - 1 > screen.bottom() - desktopFrame) {
             if(snapToMouse)
                 pos.setY(qMin(mouse.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
             else
                 pos.setY(qMax(p.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
+            qDebug() << __FUNCTION__ << "adj_dt_Y=" << pos
+                        << "bottomRight=" << QRect(pos, size).bottomRight();
         }
 
         if (pos.y() < screen.top() + desktopFrame)
@@ -2483,6 +2494,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
             }
         }
     }
+    qDebug() << __FUNCTION__ << "after adjust=" << pos
+             << "bottomRight=" << QRect(pos, size).bottomRight();
     const int subMenuOffset = style()->pixelMetric(QStyle::PM_SubMenuOverlap, 0, this);
     QMenu *caused = qobject_cast<QMenu*>(d_func()->causedPopup.widget);
     if (caused && caused->geometry().width() + menuSizeHint.width() + subMenuOffset < screen.width()) {
@@ -2510,8 +2523,12 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
                     pos.rx() = screen.x() + screen.width() - menuSizeHint.width();
             }
         }
+        qDebug() << __FUNCTION__ << "caused=" <<caused <<  pos;
     }
-    setGeometry(QRect(pos, size));
+    auto finalG = QRect(pos, size);
+    setGeometry(finalG);
+    qDebug() << __FUNCTION__ << "final=" << finalG << "bottomRight=" << finalG.bottomRight();
+
 #if QT_CONFIG(effects)
     int hGuess = isRightToLeft() ? QEffects::LeftScroll : QEffects::RightScroll;
     int vGuess = QEffects::DownScroll;
@@ -2631,6 +2648,7 @@ QAction *QMenu::exec()
 QAction *QMenu::exec(const QPoint &p, QAction *action)
 {
     Q_D(QMenu);
+    qDebug() << __FUNCTION__ << p;
     ensurePolished();
     createWinId();
     QEventLoop eventLoop;
@@ -3576,6 +3594,7 @@ void QMenu::actionEvent(QActionEvent *e)
 */
 void QMenu::internalDelayedPopup()
 {
+    qDebug() << __FUNCTION__ ;
     Q_D(QMenu);
     //hide the current item
     if (QMenu *menu = d->activeMenu) {
@@ -3614,6 +3633,7 @@ void QMenu::internalDelayedPopup()
         subMenuPos.ry() -= subMenuActionRect.top();
     }
 
+    qDebug() << __FUNCTION__ << subMenuPos;
     d->activeMenu->popup(subMenuPos);
     d->sloppyState.setSubMenuPopup(actionRect, d->currentAction, d->activeMenu);
 
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index b00b219386..d239978df9 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -725,6 +725,7 @@ void QToolButtonPrivate::_q_buttonReleased()
 
 void QToolButtonPrivate::popupTimerDone()
 {
+    qDebug() << __FUNCTION__;
     Q_Q(QToolButton);
     popupTimer.stop();
     if (!menuButtonDown && !down)
@@ -755,6 +756,8 @@ void QToolButtonPrivate::popupTimerDone()
     const QRect rect = q->rect(); // Find screen via point in case of QGraphicsProxyWidget.
     QRect screen = QDesktopWidgetPrivate::availableGeometry(q->mapToGlobal(rect.center()));
     QSize sh = ((QToolButton*)(QMenu*)actualMenu)->receivers(SIGNAL(aboutToShow()))? QSize() : actualMenu->sizeHint();
+    qDebug() << __FUNCTION__ << "actualMenu->sizeHint()" << sh << "ToolB rect=" << rect << "screen=" << screen;
+
     if (horizontal) {
         if (q->isRightToLeft()) {
             if (q->mapToGlobal(QPoint(0, rect.bottom())).y() + sh.height() <= screen.bottom()) {
@@ -788,6 +791,7 @@ void QToolButtonPrivate::popupTimerDone()
     }
     p.rx() = qMax(screen.left(), qMin(p.x(), screen.right() - sh.width()));
     p.ry() += 1;
+    qDebug() << __FUNCTION__ << "p=" << p << "bottomRight=" << QRect(p, sh).bottomRight();
     QPointer<QToolButton> that = q;
     actualMenu->setNoReplayFor(q);
     if (!mustDeleteActualMenu) //only if action are not in this widget
