summaryrefslogtreecommitdiff
path: root/libview/ev-view.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <[email protected]>2013-07-27 10:43:07 +0200
committerraveit65 <[email protected]>2017-09-06 21:19:51 +0200
commit751532c4bea353d48dbbfd5c536cfc47f7f2cbfc (patch)
tree2cfe0fc40cc4f23853cff3a2293b7258ebe1be17 /libview/ev-view.c
parent62bc1f7c30631da0fd7a0ee1294050c697e2b35b (diff)
downloadatril-751532c4bea353d48dbbfd5c536cfc47f7f2cbfc.tar.bz2
atril-751532c4bea353d48dbbfd5c536cfc47f7f2cbfc.tar.xz
libview: Stop caret cursor blinking when cursor is not in a visible page
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=570927e
Diffstat (limited to 'libview/ev-view.c')
-rw-r--r--libview/ev-view.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 50e0af2a..bb70a9cc 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -283,6 +283,9 @@ static void ev_view_primary_clear_cb (GtkClipboard
gpointer data);
static void ev_view_update_primary_selection (EvView *ev_view);
+/*** Caret navigation ***/
+static void ev_view_check_cursor_blink (EvView *ev_view);
+
G_DEFINE_TYPE_WITH_CODE (EvView, ev_view, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
@@ -792,6 +795,8 @@ view_update_range_and_current_page (EvView *view)
for (i = end; i > view->end_page && end != -1; i--) {
hide_annotation_windows (view, i);
}
+
+ ev_view_check_cursor_blink (view);
}
#define PAGE_CACHE_NUMBER 10
@@ -3239,11 +3244,20 @@ ev_view_synctex_backward_search (EvView *view,
#define CURSOR_PEND_MULTIPLIER 3
#define CURSOR_DIVIDER 3
+static inline gboolean
+cursor_is_in_visible_page (EvView *view)
+{
+ return (view->cursor_page == view->current_page ||
+ (view->cursor_page >= view->start_page &&
+ view->cursor_page <= view->end_page));
+}
+
static gboolean
cursor_should_blink (EvView *view)
{
if (view->caret_enabled &&
view->rotation == 0 &&
+ cursor_is_in_visible_page (view) &&
gtk_widget_has_focus (GTK_WIDGET (view)) &&
view->pixbuf_cache &&
!ev_pixbuf_cache_get_selection_region (view->pixbuf_cache, view->cursor_page, view->scale)) {