diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-03 12:29:28 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:17 +0200 |
commit | 7297feb6bcc89c55d1768794754f3b7d796c4c75 (patch) | |
tree | 4ace51a4630ff12dfef2cb406a45bd9b4fea7640 /desktop | |
parent | ae4f4b7192f909eb8304dcd9c644796cb3af83f8 (diff) |
LOK: reimplement lok::Document::postKeyEvent()
Instead of posting an event to the main loop of the soffice thread, do
what every other methods do: take the solar mutex and execute the task
on the thread. This fixes random lost/delayed key events on Android.
Change-Id: Ibe819282b5f3bb64e44d4b6f0a92611fe651bb39
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 450757a8351f..94c95edc515e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -688,23 +688,16 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis, pDoc->registerCallback(pCallback, pData); } -static void doc_postKeyEvent(LibreOfficeKitDocument* /*pThis*/, int nType, int nCharCode, int nKeyCode) +static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode) { -#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS) - if (SalFrame *pFocus = GetSvpFocusFrameForLibreOfficeKit()) + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) { - KeyEvent aEvent(nCharCode, nKeyCode, 0); - switch (nType) - { - case LOK_KEYEVENT_KEYINPUT: - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, GetSalFrameWindowForLibreOfficeKit(pFocus), &aEvent); - break; - case LOK_KEYEVENT_KEYUP: - Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, GetSalFrameWindowForLibreOfficeKit(pFocus), &aEvent); - break; - } + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return; } -#endif + + pDoc->postKeyEvent(nType, nCharCode, nKeyCode); } static void doc_postUnoCommand(LibreOfficeKitDocument* /*pThis*/, const char* pCommand) |