summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntia Puentes <[email protected]>2013-07-17 15:42:31 +0200
committerraveit65 <[email protected]>2017-09-06 18:25:34 +0200
commitdaae8271e55004b16c01fee5e9b2940e246ce2dc (patch)
tree1419ab877aaac5aaf1aa4226521c5dda28f3fb2d
parenta00be8874ae4b62d85909c87b011b4f1915703a1 (diff)
downloadatril-daae8271e55004b16c01fee5e9b2940e246ce2dc.tar.bz2
atril-daae8271e55004b16c01fee5e9b2940e246ce2dc.tar.xz
ev-view-accessibl: Fix get_caret_offset when the caret navigation is enabled
https://bugzilla.gnome.org/show_bug.cgi?id=704399 origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=32a67a6
-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;