summaryrefslogtreecommitdiff
path: root/vcl/source/app/weldutils.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/app/weldutils.cxx')
-rw-r--r--vcl/source/app/weldutils.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx
index 837220447063..bce1f478a1f1 100644
--- a/vcl/source/app/weldutils.cxx
+++ b/vcl/source/app/weldutils.cxx
@@ -16,6 +16,7 @@
#include <vcl/commandevent.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/event.hxx>
+#include <vcl/floatwin.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weldutils.hxx>
@@ -595,6 +596,21 @@ IMPL_LINK_NOARG(ButtonPressRepeater, RepeatTimerHdl, Timer*, void)
m_aRepeat.SetTimeout(Application::GetSettings().GetMouseSettings().GetButtonRepeat());
m_aLink.Call(m_rButton);
}
+
+weld::Window* GetPopupParent(vcl::Window& rOutWin, tools::Rectangle& rRect)
+{
+ rRect.SetPos(rOutWin.OutputToScreenPixel(rRect.TopLeft()));
+ rRect = FloatingWindow::ImplConvertToAbsPos(&rOutWin, rRect);
+
+ vcl::Window* pWin = &rOutWin;
+ while (!pWin->IsTopWindow())
+ pWin = pWin->GetParent();
+
+ rRect = FloatingWindow::ImplConvertToRelPos(pWin, rRect);
+ rRect.SetPos(pWin->ScreenToOutputPixel(rRect.TopLeft()));
+
+ return rOutWin.GetFrameWeld();
+}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */