summaryrefslogtreecommitdiff
path: root/libview/ev-view-accessible.c
diff options
context:
space:
mode:
Diffstat (limited to 'libview/ev-view-accessible.c')
-rw-r--r--libview/ev-view-accessible.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index ee35c9a7..5a9ba432 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -306,6 +306,7 @@ static gint
ev_view_accessible_get_caret_offset (AtkText *text)
{
GtkWidget *widget;
+ EvView *view;
GtkTextBuffer *buffer;
GtkTextMark *cursor_mark;
GtkTextIter cursor_itr;
@@ -316,6 +317,15 @@ ev_view_accessible_get_caret_offset (AtkText *text)
/* State is defunct */
return 0;
+ view = EV_VIEW (widget);
+
+ if (view->caret_enabled) {
+ if (view->cursor_page == view->current_page)
+ return view->cursor_offset;
+ else
+ return -1;
+ }
+
buffer = ev_view_accessible_get_text_buffer (EV_VIEW_ACCESSIBLE (text), EV_VIEW (widget));
if (!buffer)
return 0;