summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-03-04 10:03:49 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-09 10:16:11 +0100
commit0097544d43b34c8b4f4083f759ef3748aed043ea (patch)
tree38e6da56a4fc0fa55908c77e63c343e3acee53ed
parentcc7d10c04fe3047f18b6d5271a5f46a31b80d360 (diff)
lokdocview: CursorVisible -> CursorOverlayVisible
There are multiple levels of being hidden: if the cursor is not visible due to just blinking or in case it won't show up after some timeout, either. Let's use CursorOverlayVisible for the condition if the cursor should be painted right now or not, and CursorVisible for the long-term "is it visible" state. Change-Id: Ib583236c1429f25e14ba79fdabad4ea899bb4269
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitGtk.h4
-rw-r--r--libreofficekit/source/gtk/lokdocview.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index d6d720e9ec90..dbd2f8d9ff69 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -44,8 +44,8 @@ struct _LOKDocView
gboolean m_bEdit;
/// Position and size of the visible cursor.
GdkRectangle m_aVisibleCursor;
- /// Cursor is visible or hidden (for blinking).
- gboolean m_bCursorVisible;
+ /// Cursor overlay is visible or hidden (for blinking).
+ gboolean m_bCursorOverlayVisible;
/// Time of the last button press.
guint32 m_nLastButtonPressTime;
/// Time of the last button release.
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c
index 672270f0f3fb..23adab27941c 100644
--- a/libreofficekit/source/gtk/lokdocview.c
+++ b/libreofficekit/source/gtk/lokdocview.c
@@ -246,7 +246,7 @@ static void lok_docview_init( LOKDocView* pDocView )
pDocView->fZoom = 1;
pDocView->m_bEdit = FALSE;
memset(&pDocView->m_aVisibleCursor, 0, sizeof(pDocView->m_aVisibleCursor));
- pDocView->m_bCursorVisible = FALSE;
+ pDocView->m_bCursorOverlayVisible = FALSE;
pDocView->m_nLastButtonPressTime = 0;
pDocView->m_nLastButtonReleaseTime = 0;
pDocView->m_pTextSelectionRectangles = NULL;
@@ -304,10 +304,10 @@ static gboolean lcl_handleTimeout(gpointer pData)
if (pDocView->m_bEdit)
{
- if (pDocView->m_bCursorVisible)
- pDocView->m_bCursorVisible = FALSE;
+ if (pDocView->m_bCursorOverlayVisible)
+ pDocView->m_bCursorOverlayVisible = FALSE;
else
- pDocView->m_bCursorVisible = TRUE;
+ pDocView->m_bCursorOverlayVisible = TRUE;
gtk_widget_queue_draw(GTK_WIDGET(pDocView->pEventBox));
}
@@ -355,7 +355,7 @@ static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, gpoint
(void)pEvent;
pCairo = gdk_cairo_create(gtk_widget_get_window(pWidget));
- if (pDocView->m_bCursorVisible && !lcl_isEmptyRectangle(&pDocView->m_aVisibleCursor))
+ if (pDocView->m_bCursorOverlayVisible && !lcl_isEmptyRectangle(&pDocView->m_aVisibleCursor))
{
if (pDocView->m_aVisibleCursor.width == 0)
// Set a minimal width if it would be 0.
@@ -629,7 +629,7 @@ static gboolean lok_docview_callback(gpointer pData)
case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
{
pCallback->m_pDocView->m_aVisibleCursor = lcl_payloadToRectangle(pCallback->m_pPayload);
- pCallback->m_pDocView->m_bCursorVisible = TRUE;
+ pCallback->m_pDocView->m_bCursorOverlayVisible = TRUE;
gtk_widget_queue_draw(GTK_WIDGET(pCallback->m_pDocView->pEventBox));
}
break;