[evince] Scroll to the search result selected by user
mkasik
mkasik at fedoraproject.org
Wed Nov 19 11:25:15 UTC 2014
commit 0350bfe8728173b35633d7810589d3134cf77289
Author: Marek Kasik <mkasik at redhat.com>
Date: Wed Nov 19 12:24:50 2014 +0100
Scroll to the search result selected by user
Resolves: #1162254
...oll-to-the-search-result-selected-by-user.patch | 38 ++++++++++++++++++
...ct-page-when-next-search-result-requested.patch | 41 ++++++++++++++++++++
evince.spec | 13 ++++++-
3 files changed, 91 insertions(+), 1 deletions(-)
---
diff --git a/0001-Scroll-to-the-search-result-selected-by-user.patch b/0001-Scroll-to-the-search-result-selected-by-user.patch
new file mode 100644
index 0000000..2159a98
--- /dev/null
+++ b/0001-Scroll-to-the-search-result-selected-by-user.patch
@@ -0,0 +1,38 @@
+From 5310e9e9bb7e29490c89e3e53243088d7ce5f518 Mon Sep 17 00:00:00 2001
+From: Marek Kasik <mkasik at redhat.com>
+Date: Mon, 19 May 2014 14:32:19 +0200
+Subject: [PATCH 1/2] Scroll to the search result selected by user
+
+Scroll to page on which is the search result selected by user
+when not in continuous mode.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=730252
+---
+ libview/ev-view.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libview/ev-view.c b/libview/ev-view.c
+index 5ed2d78..f3aa033 100644
+--- a/libview/ev-view.c
++++ b/libview/ev-view.c
+@@ -8158,6 +8158,9 @@ jump_to_find_page (EvView *view, EvViewFindDirection direction, gint shift)
+ break;
+ }
+ }
++
++ if (!view->continuous)
++ ev_document_model_set_page (view->model, view->find_page);
+ }
+
+ static void
+@@ -8282,6 +8285,7 @@ ev_view_find_set_result (EvView *view, gint page, gint result)
+ {
+ view->find_page = page;
+ view->find_result = result;
++ jump_to_find_page (view, EV_VIEW_FIND_NEXT, 0);
+ jump_to_find_result (view);
+ gtk_widget_queue_draw (GTK_WIDGET (view));
+ }
+--
+2.1.0
+
diff --git a/0002-Show-correct-page-when-next-search-result-requested.patch b/0002-Show-correct-page-when-next-search-result-requested.patch
new file mode 100644
index 0000000..91a5836
--- /dev/null
+++ b/0002-Show-correct-page-when-next-search-result-requested.patch
@@ -0,0 +1,41 @@
+From d39c99cbb1c28a894b09f467b18e34754fd6842f Mon Sep 17 00:00:00 2001
+From: Marek Kasik <mkasik at redhat.com>
+Date: Tue, 18 Nov 2014 12:53:40 +0100
+Subject: [PATCH 2/2] Show correct page when next search result requested
+
+If there are more than 1 results on a page then requesting
+next search result from the same page will not return you
+to the page with the search results if you moved from the
+page in the meantime (when you are not in continuous mode).
+This applies also to previous results.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=730252
+---
+ libview/ev-view.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libview/ev-view.c b/libview/ev-view.c
+index f3aa033..a9159cd 100644
+--- a/libview/ev-view.c
++++ b/libview/ev-view.c
+@@ -8250,6 +8250,8 @@ ev_view_find_next (EvView *view)
+ if (view->find_result >= n_results) {
+ view->find_result = 0;
+ jump_to_find_page (view, EV_VIEW_FIND_NEXT, 1);
++ } else if (view->find_page != view->current_page) {
++ jump_to_find_page (view, EV_VIEW_FIND_NEXT, 0);
+ }
+
+ jump_to_find_result (view);
+@@ -8264,6 +8266,8 @@ ev_view_find_previous (EvView *view)
+ if (view->find_result < 0) {
+ jump_to_find_page (view, EV_VIEW_FIND_PREV, -1);
+ view->find_result = MAX (0, ev_view_find_get_n_results (view, view->find_page) - 1);
++ } else if (view->find_page != view->current_page) {
++ jump_to_find_page (view, EV_VIEW_FIND_PREV, 0);
+ }
+
+ jump_to_find_result (view);
+--
+2.1.0
+
diff --git a/evince.spec b/evince.spec
index cca7139..c2244d2 100644
--- a/evince.spec
+++ b/evince.spec
@@ -5,7 +5,7 @@
Name: evince
Version: 3.14.1
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Document viewer
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
@@ -18,6 +18,10 @@ Patch0: 0001-Disable-toggle-find-action-for-documents-not-support.patch
Patch1: 0001-Fix-runtime-critical-warning-when-starting-in-fullsc.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1162254
+Patch2: 0001-Scroll-to-the-search-result-selected-by-user.patch
+Patch3: 0002-Show-correct-page-when-next-search-result-requested.patch
+
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gtk3-devel >= %{gtk3_version}
BuildRequires: poppler-glib-devel >= %{poppler_version}
@@ -129,6 +133,8 @@ This package contains the evince web browser plugin.
%patch0 -p1 -b .toggle-find
%patch1 -p1 -b .unref
+%patch2 -p1 -b .scroll-to-search-result
+%patch3 -p1 -b .scroll-to-search-result2
%build
./autogen.sh
@@ -262,6 +268,11 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null ||:
%{_libdir}/mozilla/plugins/libevbrowserplugin.so
%changelog
+* Wed Nov 19 2014 Marek Kasik <mkasik at redhat.com> - 3.14.1-6
+- Scroll to page on which is the search result selected by user
+- when not in continuous mode.
+- Resolves: #1162254
+
* Tue Nov 18 2014 Marek Kasik <mkasik at redhat.com> - 3.14.1-5
- Use libgnome-desktop to generate and cache thumbnails
- Resolves: #1147270
More information about the scm-commits
mailing list