diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ebb52d175027..42972ce713b5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3278,7 +3278,7 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned return; } - Point aPos(nX, nY); + const Point aPos(nX, nY); MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier); if (Dialog* pDialog = dynamic_cast<Dialog*>(pWindow.get())) diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 4967144e38e4..6632364f1c6c 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -70,6 +70,7 @@ #include <comphelper/lok.hxx> #include <comphelper/solarmutex.hxx> #include <osl/process.h> +#include <comphelper/lok.hxx> #include <cassert> #include <utility> @@ -880,8 +881,12 @@ ImplSVEvent* Application::PostMouseEvent( VclEventId nEvent, vcl::Window *pWin, { Point aTransformedPos( pMouseEvent->GetPosPixel() ); - aTransformedPos.AdjustX(pWin->GetOutOffXPixel() ); - aTransformedPos.AdjustY(pWin->GetOutOffYPixel() ); + // LOK uses (0, 0) as the origin of all windows; don't offset. + if (!comphelper::LibreOfficeKit::isActive()) + { + aTransformedPos.AdjustX(pWin->GetOutOffXPixel()); + aTransformedPos.AdjustY(pWin->GetOutOffYPixel()); + } const MouseEvent aTransformedEvent( aTransformedPos, pMouseEvent->GetClicks(), pMouseEvent->GetMode(), pMouseEvent->GetButtons(), pMouseEvent->GetModifier() ); |