[evince] libmisc: Emit "updated" signal at end of search



commit 1bc6fbc41f771d023bf5be0f987baee489689a91
Author: Jason Crain <jcrain src gnome org>
Date:   Mon Jul 2 21:07:14 2018 -0500

    libmisc: Emit "updated" signal at end of search
    
    For long documents (more than 100 pages), EvSearchBox only sends the
    "updated" signal every few pages in order to make the GUI more
    reponsive, but it can miss the signal for the last few pages of the
    search. EvFindSidebar depends on this signal so this can result in
    search results for the previous few pages missing from the sidebar.
    
    Fixes https://gitlab.gnome.org/GNOME/evince/issues/917

 libmisc/ev-search-box.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/libmisc/ev-search-box.c b/libmisc/ev-search-box.c
index ee4da52d..5ae400ab 100644
--- a/libmisc/ev-search-box.c
+++ b/libmisc/ev-search-box.c
@@ -129,6 +129,10 @@ static inline gboolean
 find_check_refresh_rate (EvJobFind *job,
                          gint       page_rate)
 {
+        /* Always update if this is the last page of the search */
+        if ((job->current_page + 1) % job->n_pages == job->start_page)
+                return TRUE;
+
         return ((job->current_page % (gint)((job->n_pages / page_rate) + 1)) == 0);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]