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-05-10 12:52:42 +0200 |
commit | 4477ac0138cd23250065b10b537a95e3cac784dd (patch) | |
tree | 3357e9c5f1b47ea968bfe55d08cfc6472c794110 /sc | |
parent | 44784c7428503a5a6588ce23b52fe62404cc2f51 (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>
Diffstat (limited to 'sc')
-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 47138fb4c717..47a76af0cef3 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1312,6 +1312,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() |