summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libview/ev-view.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 0c5f6973..f0f24377 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -3950,6 +3950,16 @@ draw_caret_cursor (EvView *view,
cairo_restore (cr);
}
+static gboolean
+should_draw_caret_cursor (EvView *view,
+ gint page)
+{
+ return (view->caret_enabled &&
+ view->cursor_page == page &&
+ view->cursor_visible &&
+ gtk_widget_has_focus (GTK_WIDGET (view)));
+}
+
static void
draw_focus (EvView *view,
cairo_t *cr,
@@ -4017,7 +4027,7 @@ ev_view_draw (GtkWidget *widget,
draw_one_page (view, i, cr, &page_area, &border, area, &page_ready);
- if (page_ready && view->caret_enabled && view->cursor_page == i && view->cursor_visible)
+ if (page_ready && should_draw_caret_cursor (view, i))
draw_caret_cursor (view, cr);
if (page_ready && view->find_pages && view->highlight_find_results)
highlight_find_results (view, cr, i);