diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/qt5/QtFrame.hxx | 2 | ||||
-rw-r--r-- | vcl/qt5/QtMenu.cxx | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx index 09abe5301538..1fd010d7c8ae 100644 --- a/vcl/inc/qt5/QtFrame.hxx +++ b/vcl/inc/qt5/QtFrame.hxx @@ -131,7 +131,6 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public SalFrame bool isMinimized() const; bool isMaximized() const; void SetWindowStateImpl(Qt::WindowStates eState); - int menuBarOffset() const; void fixICCCMwindowGroup(); @@ -146,6 +145,7 @@ public: QtMainWindow* GetTopLevelWindow() const { return m_pTopLevel; } QWidget* asChild() const; qreal devicePixelRatioF() const; + int menuBarOffset() const; void Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExtentsWidth, sal_Int32 nExtentsHeight) const; diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx index b239b457ce9a..b976fa3f5739 100644 --- a/vcl/qt5/QtMenu.cxx +++ b/vcl/qt5/QtMenu.cxx @@ -837,9 +837,13 @@ bool QtMenu::ShowNativePopupMenu(FloatingWindow* pWin, const tools::Rectangle& r mpQMenu->setTearOffEnabled(bool(nFlags & FloatWinPopupFlags::AllowTearOff)); const VclPtr<vcl::Window> xParent = pWin->ImplGetWindowImpl()->mpRealParent; - const QtFrame* pFrame = static_cast<QtFrame*>(xParent->ImplGetFrame()); + tools::Rectangle aFloatRect = FloatingWindow::ImplConvertToAbsPos(xParent, rRect); + + // tdf#154447 Menu bar height has to be added + QtFrame* pFrame = static_cast<QtFrame*>(pWin->ImplGetFrame()); assert(pFrame); - const tools::Rectangle aFloatRect = FloatingWindow::ImplConvertToAbsPos(xParent, rRect); + aFloatRect.SetPosY(aFloatRect.getY() + pFrame->menuBarOffset()); + const QRect aRect = toQRect(aFloatRect, 1 / pFrame->devicePixelRatioF()); mpQMenu->exec(aRect.bottomLeft()); |