summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-09-06 14:46:19 +0200
committerraveit65 <[email protected]>2017-09-06 21:19:51 +0200
commit5c7cc863a54b87230dd5f8c97cb1a3fd0df5c2fe (patch)
treea2b3beef5d59aa4973b892e72af81d440d5b304c
parentc10fbb47f82e7cd9602c575d3739438d7a787d9c (diff)
downloadatril-5c7cc863a54b87230dd5f8c97cb1a3fd0df5c2fe.tar.bz2
atril-5c7cc863a54b87230dd5f8c97cb1a3fd0df5c2fe.tar.xz
Fix crashes of epub documents with caret-navigation
This is a quick fix for getting caret-navigation working in atril. All this code needs to be reworked for epubs. Note: caret-navigation is always enabled if text is selected with epubs, for some reasons.
-rw-r--r--shell/ev-window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index afece3ca..8e679ea9 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -603,10 +603,20 @@ ev_window_update_actions (EvWindow *ev_window)
ev_window_set_action_sensitive (ev_window, "GoLastPage", FALSE);
}
+ if (view) {
ev_window_set_action_sensitive (ev_window, "F7",
has_pages &&
ev_view_supports_caret_navigation (view) &&
!presentation_mode);
+ }
+#if ENABLE_EPUB
+ else if (webview) {
+ ev_window_set_action_sensitive (ev_window, "F7",
+ has_pages &&
+ !presentation_mode &&
+ !EV_WEB_VIEW(ev_window->priv->webview));
+}
+#endif
sizing_mode = ev_document_model_get_sizing_mode (ev_window->priv->model);
if (has_pages && sizing_mode != EV_SIZING_FIT_WIDTH && sizing_mode != EV_SIZING_FIT_PAGE) {
@@ -1424,6 +1434,7 @@ setup_view_from_metadata (EvWindow *window)
}
}
+#if !ENABLE_EPUB
/* Caret navigation mode */
if (ev_view_supports_caret_navigation (EV_VIEW (window->priv->view))) {
gboolean caret_navigation;
@@ -1447,6 +1458,7 @@ setup_view_from_metadata (EvWindow *window)
if (ev_metadata_get_boolean (window->priv->metadata, "caret-navigation", &caret_navigation))
ev_view_set_caret_navigation_enabled (EV_VIEW (window->priv->view), caret_navigation);
}
+#endif
}
static void