diff options
author | 2014-12-19 14:42:20 +0000 | |
---|---|---|
committer | 2014-12-19 14:42:20 +0000 | |
commit | e0ecb0a40e8310020f19fb3ca4a4d3e6bee11ab9 (patch) | |
tree | 1ab7dd8484c8d399712ba10fff0c5e3fc8e95cc2 /app-text/evince | |
parent | add missing required uses (diff) | |
download | gentoo-2-e0ecb0a40e8310020f19fb3ca4a4d3e6bee11ab9.tar.gz gentoo-2-e0ecb0a40e8310020f19fb3ca4a4d3e6bee11ab9.tar.bz2 gentoo-2-e0ecb0a40e8310020f19fb3ca4a4d3e6bee11ab9.zip |
Fix scrolling when search is used (#532878 by Johan Hovold), apply some more fixes from 3.12 branch. Drop old.
(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
Diffstat (limited to 'app-text/evince')
-rw-r--r-- | app-text/evince/ChangeLog | 12 | ||||
-rw-r--r-- | app-text/evince/evince-3.12.2-r1.ebuild (renamed from app-text/evince/evince-3.12.1.ebuild) | 16 | ||||
-rw-r--r-- | app-text/evince/files/evince-3.12.2-memory-leak.patch | 96 | ||||
-rw-r--r-- | app-text/evince/files/evince-3.12.2-print-center.patch | 119 | ||||
-rw-r--r-- | app-text/evince/files/evince-3.12.2-scroll-search-1.patch | 38 | ||||
-rw-r--r-- | app-text/evince/files/evince-3.12.2-scroll-search-2.patch | 41 |
6 files changed, 316 insertions, 6 deletions
diff --git a/app-text/evince/ChangeLog b/app-text/evince/ChangeLog index e2a1e805202a..b0602cf52fe6 100644 --- a/app-text/evince/ChangeLog +++ b/app-text/evince/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for app-text/evince # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/evince/ChangeLog,v 1.277 2014/12/19 13:34:40 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/evince/ChangeLog,v 1.278 2014/12/19 14:42:20 pacho Exp $ + +*evince-3.12.2-r1 (19 Dec 2014) + + 19 Dec 2014; Pacho Ramos <pacho@gentoo.org> +evince-3.12.2-r1.ebuild, + +files/evince-3.12.2-memory-leak.patch, + +files/evince-3.12.2-print-center.patch, + +files/evince-3.12.2-scroll-search-1.patch, + +files/evince-3.12.2-scroll-search-2.patch, -evince-3.12.1.ebuild: + Fix scrolling when search is used (#532878 by Johan Hovold), apply some more + fixes from 3.12 branch. Drop old. 19 Dec 2014; Pacho Ramos <pacho@gentoo.org> evince-3.12.2.ebuild: amd64 stable, bug 529964 diff --git a/app-text/evince/evince-3.12.1.ebuild b/app-text/evince/evince-3.12.2-r1.ebuild index 3ba468579d66..bc5f96fd110e 100644 --- a/app-text/evince/evince-3.12.1.ebuild +++ b/app-text/evince/evince-3.12.2-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/evince/evince-3.12.1.ebuild,v 1.4 2014/07/23 15:13:41 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/evince/evince-3.12.2-r1.ebuild,v 1.1 2014/12/19 14:42:20 pacho Exp $ EAPI="5" GCONF_DEBUG="yes" @@ -9,13 +9,13 @@ GNOME2_LA_PUNT="yes" inherit eutils gnome2 DESCRIPTION="Simple document viewer for GNOME" -HOMEPAGE="http://www.gnome.org/projects/evince/" +HOMEPAGE="https://wiki.gnome.org/Apps/Evince" LICENSE="GPL-2+ CC-BY-SA-3.0" # subslot = evd3.(suffix of libevdocument3)-evv3.(suffix of libevview3) SLOT="0/evd3.4-evv3.3" IUSE="debug djvu dvi +introspection libsecret nautilus +postscript t1lib tiff xps" -KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~x64-solaris" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~x64-solaris" # Since 2.26.2, can handle poppler without cairo support. Make it optional ? # not mature enough @@ -65,8 +65,14 @@ DEPEND="${COMMON_DEPEND} RESTRICT="test" src_prepare() { - # ??? - ELTCONF="--portage" + # Fix scrolling when searching, bug #532878 (from 'master') + epatch "${FILESDIR}"/${PN}-3.12.2-scroll-search-{1,2}.patch + + # Fix centering of documents when printing with a manual scale (from '3.12' branch) + epatch "${FILESDIR}"/${P}-print-center.patch + + # libview: fixing memory leak (from '3.12' branch) + epatch "${FILESDIR}"/${P}-memory-leak.patch gnome2_src_prepare diff --git a/app-text/evince/files/evince-3.12.2-memory-leak.patch b/app-text/evince/files/evince-3.12.2-memory-leak.patch new file mode 100644 index 000000000000..37b1f6dd1e32 --- /dev/null +++ b/app-text/evince/files/evince-3.12.2-memory-leak.patch @@ -0,0 +1,96 @@ +From 86cfddae23cacfbb24469f1926cb965522bec6ca Mon Sep 17 00:00:00 2001 +From: Giselle Reis <gisellemnr@src.gnome.org> +Date: Sat, 30 Aug 2014 00:23:04 +0200 +Subject: libview: fixing memory leak + +The memory leak was caused by a g_signal_connect +which was never disconnected. This patch makes +sure the signal is disconnected and the job is +cancelled before creating another rendering job. +It additionally introduces a helper function to +cleanly finalize the job. + +diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c +index 897d3de..22170f9 100644 +--- a/libview/ev-pixbuf-cache.c ++++ b/libview/ev-pixbuf-cache.c +@@ -161,20 +161,27 @@ ev_pixbuf_cache_finalize (GObject *object) + } + + static void ++end_job (CacheJobInfo *job_info, ++ gpointer data) ++{ ++ g_signal_handlers_disconnect_by_func (job_info->job, ++ G_CALLBACK (job_finished_cb), ++ data); ++ ev_job_cancel (job_info->job); ++ g_object_unref (job_info->job); ++ job_info->job = NULL; ++} ++ ++static void + dispose_cache_job_info (CacheJobInfo *job_info, + gpointer data) + { + if (job_info == NULL) + return; + +- if (job_info->job) { +- g_signal_handlers_disconnect_by_func (job_info->job, +- G_CALLBACK (job_finished_cb), +- data); +- ev_job_cancel (job_info->job); +- g_object_unref (job_info->job); +- job_info->job = NULL; +- } ++ if (job_info->job) ++ end_job (job_info, data); ++ + if (job_info->surface) { + cairo_surface_destroy (job_info->surface); + job_info->surface = NULL; +@@ -281,14 +288,8 @@ copy_job_to_job_info (EvJobRender *job_render, + job_info->points_set = TRUE; + } + +- if (job_info->job) { +- g_signal_handlers_disconnect_by_func (job_info->job, +- G_CALLBACK (job_finished_cb), +- pixbuf_cache); +- ev_job_cancel (job_info->job); +- g_object_unref (job_info->job); +- job_info->job = NULL; +- } ++ if (job_info->job) ++ end_job (job_info, pixbuf_cache); + + job_info->page_ready = TRUE; + } +@@ -337,12 +338,7 @@ check_job_size_and_unref (EvPixbufCache *pixbuf_cache, + height == EV_JOB_RENDER (job_info->job)->target_height) + return; + +- g_signal_handlers_disconnect_by_func (job_info->job, +- G_CALLBACK (job_finished_cb), +- pixbuf_cache); +- ev_job_cancel (job_info->job); +- g_object_unref (job_info->job); +- job_info->job = NULL; ++ end_job (job_info, pixbuf_cache); + } + + /* Do all function that copies a job from an older cache to it's position in the +@@ -651,6 +647,9 @@ add_job (EvPixbufCache *pixbuf_cache, + cairo_region_destroy (job_info->region); + job_info->region = region ? cairo_region_reference (region) : NULL; + ++ if (job_info->job) ++ end_job (job_info, pixbuf_cache); ++ + job_info->job = ev_job_render_new (pixbuf_cache->document, + page, rotation, scale, + width, height); +-- +cgit v0.10.1 + diff --git a/app-text/evince/files/evince-3.12.2-print-center.patch b/app-text/evince/files/evince-3.12.2-print-center.patch new file mode 100644 index 000000000000..96e9ae8d9f6a --- /dev/null +++ b/app-text/evince/files/evince-3.12.2-print-center.patch @@ -0,0 +1,119 @@ +From 1057dc0dd6dee5dc1992fc88b76e4c928d2ff0e7 Mon Sep 17 00:00:00 2001 +From: Carlos Garcia Campos <cgarcia@igalia.com> +Date: Thu, 14 Aug 2014 14:07:05 +0200 +Subject: print-operation: Fix centering of documents when printing with a + manual scale + +When a manual scale is used for printing, the document is not correctly +centered because the cairo context has a scale already applied. We need +to consider the current scale when centering the page and also convert +the coordinates before the cairo_translate(). + +https://bugzilla.gnome.org/show_bug.cgi?id=734788 + +diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c +index b348038..df41c60 100644 +--- a/libview/ev-print-operation.c ++++ b/libview/ev-print-operation.c +@@ -1825,6 +1825,27 @@ _print_context_get_hard_margins (GtkPrintContext *context, + } + + static void ++ev_print_operation_print_get_scaled_page_size (EvPrintOperationPrint *print, ++ gint page, ++ gdouble *width, ++ gdouble *height) ++{ ++ GtkPrintSettings *settings; ++ gdouble manual_scale; ++ ++ ev_document_get_page_size (EV_PRINT_OPERATION (print)->document, ++ page, width, height); ++ ++ settings = gtk_print_operation_get_print_settings (print->op); ++ manual_scale = gtk_print_settings_get_scale (settings) / 100.0; ++ if (manual_scale == 1.0) ++ return; ++ ++ *width *= manual_scale; ++ *height *= manual_scale; ++} ++ ++static void + ev_print_operation_print_draw_page (EvPrintOperationPrint *print, + GtkPrintContext *context, + gint page) +@@ -1834,6 +1855,7 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print, + gdouble cr_width, cr_height; + gdouble width, height, scale; + gdouble x_scale, y_scale; ++ gdouble x_offset, y_offset; + gdouble top, bottom, left, right; + + gtk_print_operation_set_defer_drawing (print->op); +@@ -1857,12 +1879,16 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print, + cr = gtk_print_context_get_cairo_context (context); + cr_width = gtk_print_context_get_width (context); + cr_height = gtk_print_context_get_height (context); +- ev_document_get_page_size (op->document, page, &width, &height); ++ ev_print_operation_print_get_scaled_page_size (print, page, &width, &height); + + if (print->page_scale == EV_SCALE_NONE) { + /* Center document page on the printed page */ +- if (print->autorotate) +- cairo_translate (cr, (cr_width - width) / 2, (cr_height - height) / 2); ++ if (print->autorotate) { ++ x_offset = (cr_width - width) / 2; ++ y_offset = (cr_height - height) / 2; ++ cairo_device_to_user (cr, &x_offset, &y_offset); ++ cairo_translate (cr, x_offset, y_offset); ++ } + } else { + _print_context_get_hard_margins (context, &top, &bottom, &left, &right); + +@@ -1875,29 +1901,27 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print, + scale = 1.0; + + if (print->autorotate) { +- double left_right_sides, top_bottom_sides; +- +- cairo_translate (cr, (cr_width - scale * width) / 2, +- (cr_height - scale * height) / 2); ++ x_offset = (cr_width - scale * width) / 2; ++ y_offset = (cr_height - scale * height) / 2; ++ cairo_device_to_user (cr, &x_offset, &y_offset); ++ cairo_translate (cr, x_offset, y_offset); + + /* Ensure document page is within the margins. The + * scale guarantees the document will fit in the + * margins so we just need to check each side and + * if it overhangs the margin, translate it to the +- * margin. */ +- left_right_sides = (cr_width - width*scale)/2; +- top_bottom_sides = (cr_height - height*scale)/2; +- if (left_right_sides < left) +- cairo_translate (cr, left - left_right_sides, 0); ++ * margin. */ ++ if (x_offset < left) ++ cairo_translate (cr, left - x_offset, 0); + +- if (left_right_sides < right) +- cairo_translate (cr, -(right - left_right_sides), 0); ++ if (x_offset < right) ++ cairo_translate (cr, -(right - x_offset), 0); + +- if (top_bottom_sides < top) +- cairo_translate (cr, 0, top - top_bottom_sides); ++ if (y_offset < top) ++ cairo_translate (cr, 0, top - y_offset); + +- if (top_bottom_sides < bottom) +- cairo_translate (cr, 0, -(bottom - top_bottom_sides)); ++ if (y_offset < bottom) ++ cairo_translate (cr, 0, -(bottom - y_offset)); + } else { + cairo_translate (cr, left, top); + } +-- +cgit v0.10.1 + diff --git a/app-text/evince/files/evince-3.12.2-scroll-search-1.patch b/app-text/evince/files/evince-3.12.2-scroll-search-1.patch new file mode 100644 index 000000000000..af985baa5c17 --- /dev/null +++ b/app-text/evince/files/evince-3.12.2-scroll-search-1.patch @@ -0,0 +1,38 @@ +From 2cb9d88d7b396b6ac4bb01c035a40b48da419b65 Mon Sep 17 00:00:00 2001 +From: Marek Kasik <mkasik@redhat.com> +Date: Mon, 19 May 2014 14:32:19 +0200 +Subject: [PATCH 1/2] [libview] 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 7618bbd..393bf77 100644 +--- a/libview/ev-view.c ++++ b/libview/ev-view.c +@@ -7684,6 +7684,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 +@@ -7808,6 +7811,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)); + } +-- +1.9.0 + diff --git a/app-text/evince/files/evince-3.12.2-scroll-search-2.patch b/app-text/evince/files/evince-3.12.2-scroll-search-2.patch new file mode 100644 index 000000000000..f7dfaef773d7 --- /dev/null +++ b/app-text/evince/files/evince-3.12.2-scroll-search-2.patch @@ -0,0 +1,41 @@ +From dd3df79ea999850c737b049081d81afa59af22d3 Mon Sep 17 00:00:00 2001 +From: Marek Kasik <mkasik@redhat.com> +Date: Tue, 18 Nov 2014 12:53:40 +0100 +Subject: [PATCH] [libview] 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 + |