From 3a84543c9b52f681304564ebfb00db8da6a1d407 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 10 May 2021 10:11:53 +0200 Subject: LOK: inform when input bar has cursor and focus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119153 Tested-by: Jenkins --- sc/source/ui/app/inputwin.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sc/source') 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 pParent = mrGroupBar.GetVclParent().GetParentWithLOKNotifier(); + if (!pParent) + return; + + const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier(); + std::vector aItems; + aItems.emplace_back("visible", bIsFocused ? "true" : "false"); + pNotifier->notifyWindow(pParent->GetLOKWindowId(), "cursor_visible", aItems); + } } EditView* ScTextWnd::GetEditView() const -- cgit