summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-12-17 14:44:51 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-12-18 13:00:47 +0100
commit70f2fc7a10f41204e353bd3487377983a1018b53 (patch)
tree3e3a70ef81cfce3c40b856d5121b02b170620832
parent49b7d99af0edc46793c9955061eaee78e7f7822f (diff)
lok: don't use focus window to request help
Use clicked button instead - what leads to the correct window. If only focused window was taken into account sometimes it caused incorrect help link to be used. Change-Id: I645dc1ffa6a6d6d363ea5f9874fa830c441516c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107882 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--vcl/source/app/salvtables.cxx3
-rw-r--r--vcl/source/control/button.cxx2
-rw-r--r--vcl/source/window/dialog.cxx2
3 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index af2f66ca9b0e..4285b037c880 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -70,6 +70,7 @@
#include <bitmaps.hlst>
#include <wizdlg.hxx>
#include <vcl/salvtables.hxx>
+#include <comphelper/lok.hxx>
SalFrame::SalFrame()
: m_pWindow(nullptr)
@@ -6218,7 +6219,7 @@ void SalInstanceWindow::help()
{
//show help for widget with keyboard focus
vcl::Window* pWidget = ImplGetSVData()->mpWinData->mpFocusWin;
- if (!pWidget)
+ if (!pWidget || comphelper::LibreOfficeKit::isActive())
pWidget = m_xWindow;
OString sHelpId = pWidget->GetHelpId();
while (sHelpId.isEmpty())
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index a4ae36cffe15..fecb052628b7 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1774,7 +1774,7 @@ void HelpButton::Click()
if ( !GetClickHdl() )
{
vcl::Window* pFocusWin = Application::GetFocusWindow();
- if ( !pFocusWin )
+ if ( !pFocusWin || comphelper::LibreOfficeKit::isActive() )
pFocusWin = this;
HelpEvent aEvt( pFocusWin->GetPointerPosPixel(), HelpEventMode::CONTEXT );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index df9135f43058..536228b97ec8 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1374,7 +1374,7 @@ IMPL_LINK(Dialog, ResponseHdl, Button*, pButton, void)
if (nResponse == RET_HELP)
{
vcl::Window* pFocusWin = Application::GetFocusWindow();
- if (!pFocusWin)
+ if (!pFocusWin || comphelper::LibreOfficeKit::isActive())
pFocusWin = pButton;
HelpEvent aEvt(pFocusWin->GetPointerPosPixel(), HelpEventMode::CONTEXT);
pFocusWin->RequestHelp(aEvt);