diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-05-10 10:11:53 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-07-19 10:25:07 +0200 |
commit | 3a84543c9b52f681304564ebfb00db8da6a1d407 (patch) | |
tree | 58fca89822ed2c2bbead0999bfb9b0a34dab530e /sc/source | |
parent | 4bd116b28e8266558e40a8e7bf303a53da6a5730 (diff) |
LOK: inform when input bar has cursor and focus
Now the cursor is rendered on the Drawing Area so
we need to send special message to inform that
cursor is shown. This fixes bug in online where
without cursor instead of sending character to
formula bar is was send to the spreadsheet and
formula bar was loosing focus at that time.
Change-Id: I0b1e03900bec855b1378da364f0391f50dbceccb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115310
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119153
Tested-by: Jenkins
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 3d87b97de754..7aa3084fe84e 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1313,6 +1313,26 @@ void ScTextWnd::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangl } else WeldEditView::Paint(rRenderContext, rRect); + + if (comphelper::LibreOfficeKit::isActive()) + { + bool bIsFocused = false; + if (HasFocus()) + { + vcl::Cursor* pCursor = m_xEditView->GetCursor(); + if (pCursor) + bIsFocused = true; + } + + VclPtr<vcl::Window> pParent = mrGroupBar.GetVclParent().GetParentWithLOKNotifier(); + if (!pParent) + return; + + const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier(); + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("visible", bIsFocused ? "true" : "false"); + pNotifier->notifyWindow(pParent->GetLOKWindowId(), "cursor_visible", aItems); + } } EditView* ScTextWnd::GetEditView() const |