include/LibreOfficeKit/LibreOfficeKitEnums.h | 6 +++--- libreofficekit/source/gtk/lokdocview.c | 2 +- sw/source/core/crsr/crsrsh.cxx | 16 ++++++++-------- sw/source/core/crsr/viscrs.cxx | 6 ------ 4 files changed, 12 insertions(+), 18 deletions(-)
New commits: commit 718e663306d9f4eba45512d198ed173f440c3c59 Author: Miklos Vajna <[email protected]> Date: Fri Mar 6 11:02:40 2015 +0100 sw: move LOK_CALLBACK_CURSOR_VISIBLE event from SwVisCrsr to SwCrsrShell This should fix the problem that LOK_CALLBACK_CURSOR_VISIBLE is emitted 2 times during every mouse click (hide, then show), while the motivation behind this callback is to just hide the blinking cursor for image selection, i.e. it's never emitted during normal text editing. Change-Id: Id2a2b1102589f8151f640af3fcb50b646d261275 diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 1cb3da4..cc5a32b 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -83,9 +83,9 @@ typedef enum /** * The blinking text cursor is now visible or not. * - * Clients should assume that this is false initially and are expected to - * show a blinking cursor at the rectangle described by - * LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR once it becomes true. Payload is + * Clients should assume that this is true initially and are expected to + * hide the blinking cursor at the rectangle described by + * LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR once it becomes false. Payload is * either the "true" or the "false" string. */ LOK_CALLBACK_CURSOR_VISIBLE, diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index a6108bd..a6b2d1c 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -247,7 +247,7 @@ static void lok_docview_init( LOKDocView* pDocView ) pDocView->m_bEdit = FALSE; memset(&pDocView->m_aVisibleCursor, 0, sizeof(pDocView->m_aVisibleCursor)); pDocView->m_bCursorOverlayVisible = FALSE; - pDocView->m_bCursorVisible = FALSE; + pDocView->m_bCursorVisible = TRUE; pDocView->m_nLastButtonPressTime = 0; pDocView->m_nLastButtonReleaseTime = 0; pDocView->m_pTextSelectionRectangles = NULL; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 982a2ac..ef020fd 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -62,6 +62,7 @@ #include <globals.hrc> #include <comcore.hrc> #include <IDocumentLayoutAccess.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> #if defined(IOS) #include <touch/touch.h> @@ -2119,10 +2120,10 @@ void SwCrsrShell::ShowCrsr() { m_bSVCrsrVis = true; m_pCurCrsr->SetShowTxtInputFldOverlay( true ); -#if defined(IOS) - // This was dummied out both for Android and for TiledLibreOffice (iOS) anyway - // touch_ui_show_keyboard(); -#endif + + if (isTiledRendering()) + libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr()); + UpdateCrsr(); } } @@ -2136,10 +2137,9 @@ void SwCrsrShell::HideCrsr() SET_CURR_SHELL( this ); m_pCurCrsr->SetShowTxtInputFldOverlay( false ); m_pVisCrsr->Hide(); -#if defined(IOS) - // This was dummied out both for Android and for TiledLibreOffice (iOS) anyway - // touch_ui_hide_keyboard(); -#endif + + if (isTiledRendering()) + libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr()); } } diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 28f6a61..c0b4a33 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -93,16 +93,10 @@ void SwVisCrsr::Show() if( m_pCrsrShell->VisArea().IsOver( m_pCrsrShell->m_aCharRect ) || m_pCrsrShell->isTiledRendering() ) _SetPosAndShow(); } - - if (m_pCrsrShell->isTiledRendering()) - m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr()); } void SwVisCrsr::Hide() { - if (m_pCrsrShell->isTiledRendering()) - m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr()); - if( m_bIsVisible ) { m_bIsVisible = false; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
